@hasna/evals 0.1.24 → 0.1.26

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.
Files changed (103) hide show
  1. package/dist/adapters/adapters.test.d.ts +2 -0
  2. package/dist/adapters/adapters.test.d.ts.map +1 -0
  3. package/dist/adapters/anthropic-openai.test.d.ts +2 -0
  4. package/dist/adapters/anthropic-openai.test.d.ts.map +1 -0
  5. package/dist/adapters/anthropic.d.ts +4 -0
  6. package/dist/adapters/anthropic.d.ts.map +1 -0
  7. package/dist/adapters/cli.d.ts +4 -0
  8. package/dist/adapters/cli.d.ts.map +1 -0
  9. package/dist/adapters/function.d.ts +4 -0
  10. package/dist/adapters/function.d.ts.map +1 -0
  11. package/dist/adapters/http-cli-coverage.test.d.ts +2 -0
  12. package/dist/adapters/http-cli-coverage.test.d.ts.map +1 -0
  13. package/dist/adapters/http.d.ts +16 -0
  14. package/dist/adapters/http.d.ts.map +1 -0
  15. package/dist/adapters/mcp-adapter.test.d.ts +2 -0
  16. package/dist/adapters/mcp-adapter.test.d.ts.map +1 -0
  17. package/dist/adapters/mcp.d.ts +4 -0
  18. package/dist/adapters/mcp.d.ts.map +1 -0
  19. package/dist/adapters/openai.d.ts +4 -0
  20. package/dist/adapters/openai.d.ts.map +1 -0
  21. package/dist/cli/adapter-parser.d.ts +3 -0
  22. package/dist/cli/adapter-parser.d.ts.map +1 -0
  23. package/dist/cli/cli.test.d.ts +2 -0
  24. package/dist/cli/cli.test.d.ts.map +1 -0
  25. package/dist/cli/commands/calibrate.d.ts +3 -0
  26. package/dist/cli/commands/calibrate.d.ts.map +1 -0
  27. package/dist/cli/commands/capture.d.ts +3 -0
  28. package/dist/cli/commands/capture.d.ts.map +1 -0
  29. package/dist/cli/commands/ci.d.ts +3 -0
  30. package/dist/cli/commands/ci.d.ts.map +1 -0
  31. package/dist/cli/commands/compare.d.ts +5 -0
  32. package/dist/cli/commands/compare.d.ts.map +1 -0
  33. package/dist/cli/commands/compare.test.d.ts +2 -0
  34. package/dist/cli/commands/compare.test.d.ts.map +1 -0
  35. package/dist/cli/commands/completion.d.ts +3 -0
  36. package/dist/cli/commands/completion.d.ts.map +1 -0
  37. package/dist/cli/commands/doctor.d.ts +3 -0
  38. package/dist/cli/commands/doctor.d.ts.map +1 -0
  39. package/dist/cli/commands/estimate.d.ts +3 -0
  40. package/dist/cli/commands/estimate.d.ts.map +1 -0
  41. package/dist/cli/commands/generate.d.ts +3 -0
  42. package/dist/cli/commands/generate.d.ts.map +1 -0
  43. package/dist/cli/commands/judge.d.ts +3 -0
  44. package/dist/cli/commands/judge.d.ts.map +1 -0
  45. package/dist/cli/commands/mcp.d.ts +3 -0
  46. package/dist/cli/commands/mcp.d.ts.map +1 -0
  47. package/dist/cli/commands/run.d.ts +3 -0
  48. package/dist/cli/commands/run.d.ts.map +1 -0
  49. package/dist/cli/commands/sync.d.ts +3 -0
  50. package/dist/cli/commands/sync.d.ts.map +1 -0
  51. package/dist/cli/index.d.ts +3 -0
  52. package/dist/cli/index.d.ts.map +1 -0
  53. package/dist/cli/index.js +857 -170
  54. package/dist/core/assertions-coverage.test.d.ts +2 -0
  55. package/dist/core/assertions-coverage.test.d.ts.map +1 -0
  56. package/dist/core/assertions.d.ts +18 -0
  57. package/dist/core/assertions.d.ts.map +1 -0
  58. package/dist/core/assertions.test.d.ts +2 -0
  59. package/dist/core/assertions.test.d.ts.map +1 -0
  60. package/dist/core/e2e.test.d.ts +2 -0
  61. package/dist/core/e2e.test.d.ts.map +1 -0
  62. package/dist/core/judge.d.ts +13 -0
  63. package/dist/core/judge.d.ts.map +1 -0
  64. package/dist/core/judge.test.d.ts +2 -0
  65. package/dist/core/judge.test.d.ts.map +1 -0
  66. package/dist/core/reporter.d.ts +21 -0
  67. package/dist/core/reporter.d.ts.map +1 -0
  68. package/dist/core/reporter.test.d.ts +2 -0
  69. package/dist/core/reporter.test.d.ts.map +1 -0
  70. package/dist/core/runner.d.ts +4 -0
  71. package/dist/core/runner.d.ts.map +1 -0
  72. package/dist/core/runner.test.d.ts +2 -0
  73. package/dist/core/runner.test.d.ts.map +1 -0
  74. package/dist/datasets/loader.d.ts +18 -0
  75. package/dist/datasets/loader.d.ts.map +1 -0
  76. package/dist/datasets/loader.test.d.ts +2 -0
  77. package/dist/datasets/loader.test.d.ts.map +1 -0
  78. package/dist/db/store.d.ts +17 -0
  79. package/dist/db/store.d.ts.map +1 -0
  80. package/dist/db/store.test.d.ts +2 -0
  81. package/dist/db/store.test.d.ts.map +1 -0
  82. package/dist/index.d.ts +8 -0
  83. package/dist/index.d.ts.map +1 -0
  84. package/dist/index.js +24 -4
  85. package/dist/mcp/http.d.ts +13 -0
  86. package/dist/mcp/http.d.ts.map +1 -0
  87. package/dist/mcp/http.test.d.ts +2 -0
  88. package/dist/mcp/http.test.d.ts.map +1 -0
  89. package/dist/mcp/index.d.ts +3 -0
  90. package/dist/mcp/index.d.ts.map +1 -0
  91. package/dist/mcp/index.js +32454 -477
  92. package/dist/mcp/mcp.test.d.ts +2 -0
  93. package/dist/mcp/mcp.test.d.ts.map +1 -0
  94. package/dist/mcp/server.d.ts +5 -0
  95. package/dist/mcp/server.d.ts.map +1 -0
  96. package/dist/server/index.d.ts +3 -0
  97. package/dist/server/index.d.ts.map +1 -0
  98. package/dist/server/index.js +24 -4
  99. package/dist/server/server.test.d.ts +2 -0
  100. package/dist/server/server.test.d.ts.map +1 -0
  101. package/dist/types/index.d.ts +171 -0
  102. package/dist/types/index.d.ts.map +1 -0
  103. package/package.json +3 -2
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=assertions-coverage.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertions-coverage.test.d.ts","sourceRoot":"","sources":["../../src/core/assertions-coverage.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import type { Assertion, AssertionResult } from "../types/index.js";
2
+ export declare function sortAssertionsCheapestFirst(assertions: Assertion[]): Assertion[];
3
+ export interface AssertionContext {
4
+ output: string;
5
+ durationMs?: number;
6
+ inputTokens?: number;
7
+ outputTokens?: number;
8
+ costUsd?: number;
9
+ toolCalls?: Array<{
10
+ name: string;
11
+ arguments?: Record<string, unknown>;
12
+ }>;
13
+ }
14
+ export declare function runAssertion(assertion: Assertion, ctx: AssertionContext): Promise<AssertionResult>;
15
+ export declare function runAssertions(assertions: Assertion[], ctx: AssertionContext): Promise<AssertionResult[]>;
16
+ export declare function assertionsPassed(results: AssertionResult[]): boolean;
17
+ export declare function allAssertionsPassed(results: AssertionResult[]): boolean;
18
+ //# sourceMappingURL=assertions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertions.d.ts","sourceRoot":"","sources":["../../src/core/assertions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AA6BpE,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAMhF;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CAC1E;AAED,wBAAsB,YAAY,CAChC,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,gBAAgB,GACpB,OAAO,CAAC,eAAe,CAAC,CAqB1B;AAED,wBAAsB,aAAa,CACjC,UAAU,EAAE,SAAS,EAAE,EACvB,GAAG,EAAE,gBAAgB,GACpB,OAAO,CAAC,eAAe,EAAE,CAAC,CAyB5B;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,CAKpE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,OAAO,CAEvE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=assertions.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertions.test.d.ts","sourceRoot":"","sources":["../../src/core/assertions.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare function echoInput(input: string): Promise<string>;
2
+ //# sourceMappingURL=e2e.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"e2e.test.d.ts","sourceRoot":"","sources":["../../src/core/e2e.test.ts"],"names":[],"mappings":"AAyBA,wBAAsB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9D"}
@@ -0,0 +1,13 @@
1
+ import type { JudgeConfig, JudgeResult } from "../types/index.js";
2
+ export declare function runJudge(input: string, output: string, config: JudgeConfig, expected?: string): Promise<JudgeResult>;
3
+ /** One-shot judge: no full eval case, just input/output/rubric */
4
+ export declare function judgeOnce(params: {
5
+ input: string;
6
+ output: string;
7
+ rubric: string;
8
+ expected?: string;
9
+ model?: string;
10
+ provider?: "anthropic" | "openai";
11
+ apiKey?: string;
12
+ }): Promise<JudgeResult>;
13
+ //# sourceMappingURL=judge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judge.d.ts","sourceRoot":"","sources":["../../src/core/judge.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAW,MAAM,mBAAmB,CAAC;AA4E3E,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,EACnB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,WAAW,CAAC,CAmBtB;AA4ED,kEAAkE;AAClE,wBAAsB,SAAS,CAAC,MAAM,EAAE;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,WAAW,CAAC,CAOvB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=judge.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"judge.test.d.ts","sourceRoot":"","sources":["../../src/core/judge.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ import type { EvalRun, Verdict } from "../types/index.js";
2
+ export declare function printTerminalReport(run: EvalRun): void;
3
+ export declare function toJson(run: EvalRun): string;
4
+ export declare function toMarkdown(run: EvalRun): string;
5
+ export interface RunDiff {
6
+ regressions: Array<{
7
+ caseId: string;
8
+ before: Verdict;
9
+ after: Verdict;
10
+ }>;
11
+ improvements: Array<{
12
+ caseId: string;
13
+ before: Verdict;
14
+ after: Verdict;
15
+ }>;
16
+ scoreDelta: number;
17
+ passRateDelta: number;
18
+ }
19
+ export declare function compareRuns(before: EvalRun, after: EvalRun): RunDiff;
20
+ export declare function printDiffReport(diff: RunDiff): void;
21
+ //# sourceMappingURL=reporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporter.d.ts","sourceRoot":"","sources":["../../src/core/reporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAgB1D,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAoCtD;AAID,wBAAgB,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAE3C;AAID,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAkD/C;AAID,MAAM,WAAW,OAAO;IACtB,WAAW,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACxE,YAAY,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACzE,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAuBpE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAcnD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=reporter.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reporter.test.d.ts","sourceRoot":"","sources":["../../src/core/reporter.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { AdapterConfig, EvalCase, EvalResult, EvalRun, RunOptions } from "../types/index.js";
2
+ export declare function runEvals(cases: EvalCase[], options: RunOptions): Promise<EvalRun>;
3
+ export declare function runSingleCase(evalCase: EvalCase, adapterConfig: AdapterConfig, skipJudge?: boolean): Promise<EvalResult>;
4
+ //# sourceMappingURL=runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/core/runner.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,aAAa,EACb,QAAQ,EACR,UAAU,EACV,OAAO,EAEP,UAAU,EAGX,MAAM,mBAAmB,CAAC;AAqI3B,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,QAAQ,EAAE,EACjB,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,OAAO,CAAC,CAqClB;AAID,wBAAsB,aAAa,CACjC,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,SAAS,UAAQ,GAChB,OAAO,CAAC,UAAU,CAAC,CAKrB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=runner.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner.test.d.ts","sourceRoot":"","sources":["../../src/core/runner.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import type { EvalCase } from "../types/index.js";
2
+ export interface LoadOptions {
3
+ /** Fail hard on malformed lines instead of warning and skipping */
4
+ strict?: boolean;
5
+ /** Filter by tags */
6
+ tags?: string[];
7
+ }
8
+ export interface LoadResult {
9
+ cases: EvalCase[];
10
+ warnings: string[];
11
+ totalLines: number;
12
+ skipped: number;
13
+ }
14
+ /** Load eval cases from a JSONL or JSON file (or glob pattern) */
15
+ export declare function loadDataset(pathOrGlob: string, opts?: LoadOptions): Promise<LoadResult>;
16
+ /** Stream large JSONL files case-by-case (for very large datasets) */
17
+ export declare function streamDataset(path: string, opts?: LoadOptions): AsyncGenerator<EvalCase>;
18
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/datasets/loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,MAAM,WAAW,WAAW;IAC1B,mEAAmE;IACnE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,kEAAkE;AAClE,wBAAsB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CAiCjG;AAoFD,sEAAsE;AACtE,wBAAuB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,cAAc,CAAC,QAAQ,CAAC,CAyBnG"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=loader.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.test.d.ts","sourceRoot":"","sources":["../../src/datasets/loader.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import { Database } from "bun:sqlite";
2
+ import type { EvalRun } from "../types/index.js";
3
+ export declare function getDatabase(): Database;
4
+ export declare function closeDatabase(): void;
5
+ export declare function saveRun(run: EvalRun): void;
6
+ export declare function getRun(id: string): EvalRun | null;
7
+ export declare function listRuns(limit?: number, dataset?: string): EvalRun[];
8
+ export declare function deleteRun(id: string): void;
9
+ export declare function setBaseline(name: string, runId: string): void;
10
+ export declare function getBaseline(name: string): EvalRun | null;
11
+ export declare function listBaselines(): Array<{
12
+ name: string;
13
+ runId: string;
14
+ createdAt: string;
15
+ }>;
16
+ export declare function clearBaseline(name: string): void;
17
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/db/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAQjD,wBAAgB,WAAW,IAAI,QAAQ,CAUtC;AAED,wBAAgB,aAAa,IAAI,IAAI,CAGpC;AA6BD,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAa1C;AAED,wBAAgB,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAIjD;AAED,wBAAgB,QAAQ,CAAC,KAAK,SAAK,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,EAAE,CAMhE;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAE1C;AAID,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAI7D;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAKxD;AAED,wBAAgB,aAAa,IAAI,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAKzF;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEhD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=store.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.test.d.ts","sourceRoot":"","sources":["../../src/db/store.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export * from "./types/index.js";
2
+ export * from "./core/runner.js";
3
+ export * from "./core/assertions.js";
4
+ export * from "./core/judge.js";
5
+ export * from "./core/reporter.js";
6
+ export * from "./datasets/loader.js";
7
+ export * from "./db/store.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -11667,7 +11667,7 @@ var safeJSON2 = (text) => {
11667
11667
  var sleep2 = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
11668
11668
 
11669
11669
  // node_modules/openai/version.mjs
11670
- var VERSION2 = "6.39.0";
11670
+ var VERSION2 = "6.42.0";
11671
11671
 
11672
11672
  // node_modules/openai/internal/detect-platform.mjs
11673
11673
  var isRunningInBrowser2 = () => {
@@ -18253,7 +18253,10 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
18253
18253
  if (isTimeout) {
18254
18254
  throw new APIConnectionTimeoutError2;
18255
18255
  }
18256
- throw new APIConnectionError2({ cause: response });
18256
+ throw new APIConnectionError2({
18257
+ message: getConnectionErrorMessage(response),
18258
+ cause: response
18259
+ });
18257
18260
  }
18258
18261
  const specialHeaders = [...response.headers.entries()].filter(([name]) => name === "x-request-id").map(([name, value]) => ", " + name + ": " + JSON.stringify(value)).join("");
18259
18262
  const responseInfo = `[${requestLogID}${retryLogStr}${specialHeaders}] ${req.method} ${url} ${response.ok ? "succeeded" : "failed"} with status ${response.status} in ${headersTime - startTime}ms`;
@@ -18526,6 +18529,23 @@ OpenAI.Evals = Evals;
18526
18529
  OpenAI.Containers = Containers;
18527
18530
  OpenAI.Skills = Skills2;
18528
18531
  OpenAI.Videos = Videos;
18532
+ function getConnectionErrorMessage(error3) {
18533
+ if (isUndiciDispatcherVersionMismatchError(error3)) {
18534
+ return `Connection error. This may be caused by passing an undici dispatcher, such as ProxyAgent, that is incompatible with the fetch implementation. If you are using undici's ProxyAgent, pass the fetch implementation from the same undici package: import { fetch, ProxyAgent } from 'undici'; new OpenAI({ fetch, fetchOptions: { dispatcher: new ProxyAgent(...) } });`;
18535
+ }
18536
+ return;
18537
+ }
18538
+ function isUndiciDispatcherVersionMismatchError(error3) {
18539
+ let current = error3;
18540
+ for (let i = 0;i < 8 && current && typeof current === "object"; i++) {
18541
+ const err = current;
18542
+ if (err.code === "UND_ERR_INVALID_ARG" && typeof err.message === "string" && err.message.includes("invalid onRequestStart method")) {
18543
+ return true;
18544
+ }
18545
+ current = err.cause;
18546
+ }
18547
+ return false;
18548
+ }
18529
18549
  // node_modules/openai/azure.mjs
18530
18550
  var _deployments_endpoints = new Set([
18531
18551
  "/completions",
@@ -22596,7 +22616,7 @@ function finalize(ctx, schema) {
22596
22616
  result.$schema = "http://json-schema.org/draft-07/schema#";
22597
22617
  } else if (ctx.target === "draft-04") {
22598
22618
  result.$schema = "http://json-schema.org/draft-04/schema#";
22599
- } else if (ctx.target === "openapi-3.0") {} else {}
22619
+ } else if (ctx.target === "openapi-3.0") {}
22600
22620
  if (ctx.external?.uri) {
22601
22621
  const id = ctx.external.registry.get(schema)?.id;
22602
22622
  if (!id)
@@ -22814,7 +22834,7 @@ var literalProcessor = (schema, ctx, json, _params) => {
22814
22834
  if (val === undefined) {
22815
22835
  if (ctx.unrepresentable === "throw") {
22816
22836
  throw new Error("Literal `undefined` cannot be represented in JSON Schema");
22817
- } else {}
22837
+ }
22818
22838
  } else if (typeof val === "bigint") {
22819
22839
  if (ctx.unrepresentable === "throw") {
22820
22840
  throw new Error("BigInt literals cannot be represented in JSON Schema");
@@ -0,0 +1,13 @@
1
+ import { DEFAULT_MCP_HTTP_PORT, MCP_NAME } from "./server.js";
2
+ export { DEFAULT_MCP_HTTP_PORT, MCP_NAME };
3
+ export declare function isHttpMode(argv?: string[]): boolean;
4
+ export declare function isStdioMode(argv?: string[]): boolean;
5
+ export declare function resolveHttpPort(argv?: string[]): number;
6
+ export declare function handleMcpHttpRequest(req: Request): Promise<Response>;
7
+ export interface StartHttpServerOptions {
8
+ port?: number;
9
+ hostname?: string;
10
+ log?: (message: string) => void;
11
+ }
12
+ export declare function startHttpServer(options?: StartHttpServerOptions): ReturnType<typeof Bun.serve>;
13
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/mcp/http.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,qBAAqB,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE3E,OAAO,EAAE,qBAAqB,EAAE,QAAQ,EAAE,CAAC;AAE3C,wBAAgB,UAAU,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,OAAO,CAE1E;AAED,wBAAgB,WAAW,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,OAAO,CAE3E;AAED,wBAAgB,eAAe,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,MAAM,CAa9E;AAUD,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAiB1E;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,KAAK,CAAC,CAclG"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=http.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.test.d.ts","sourceRoot":"","sources":["../../src/mcp/http.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bun
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp/index.ts"],"names":[],"mappings":""}