anpord 0.1.7 → 0.1.8

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 (48) hide show
  1. package/README.md +36 -1
  2. package/dist/calls-DYqBi5FA.d.cts +13 -0
  3. package/dist/calls-DYqBi5FA.d.mts +13 -0
  4. package/dist/cli.cjs +621 -62
  5. package/dist/cli.mjs +621 -62
  6. package/dist/{client-D0Rd_z6s.mjs → client-5K3dMI5Q.mjs} +236 -120
  7. package/dist/client-C9m0uLCz.d.cts +3518 -0
  8. package/dist/{client-Dy5oayYb.cjs → client-Ci0woWLW.cjs} +236 -120
  9. package/dist/client-TFCLuMv8.d.mts +3518 -0
  10. package/dist/compiler-Dj-0uzC6.mjs +586 -0
  11. package/dist/compiler-DpQHrrv6.cjs +597 -0
  12. package/dist/config.cjs +5 -1
  13. package/dist/config.d.cts +5 -2
  14. package/dist/config.d.mts +5 -2
  15. package/dist/config.mjs +5 -3
  16. package/dist/define-HK0eeSNn.d.cts +48 -0
  17. package/dist/define-HK0eeSNn.d.mts +48 -0
  18. package/dist/errors-BK3f7Rdr.d.cts +37 -0
  19. package/dist/errors-BK3f7Rdr.d.mts +37 -0
  20. package/dist/eval.cjs +1 -1
  21. package/dist/eval.d.cts +96 -3
  22. package/dist/eval.d.mts +96 -3
  23. package/dist/eval.mjs +1 -1
  24. package/dist/{source-DZEcNQVL.d.cts → evals-BEgEmfiO.d.cts} +137 -16
  25. package/dist/{source-DZEcNQVL.d.mts → evals-BEgEmfiO.d.mts} +137 -16
  26. package/dist/harness-profile-BMjsN460.mjs +43 -0
  27. package/dist/harness-profile-CDQpPLPd.cjs +78 -0
  28. package/dist/index.cjs +1 -1
  29. package/dist/index.d.cts +8 -2865
  30. package/dist/index.d.mts +8 -2865
  31. package/dist/index.mjs +1 -1
  32. package/dist/mcp-runtime.cjs +111 -0
  33. package/dist/mcp-runtime.d.cts +7 -0
  34. package/dist/mcp-runtime.d.mts +7 -0
  35. package/dist/mcp-runtime.mjs +109 -0
  36. package/dist/mcp.cjs +32 -0
  37. package/dist/mcp.d.cts +3 -0
  38. package/dist/mcp.d.mts +3 -0
  39. package/dist/mcp.mjs +29 -0
  40. package/dist/source.d.cts +6 -1
  41. package/dist/source.d.mts +6 -1
  42. package/dist/types-CtIaEg8h.d.mts +207 -0
  43. package/dist/types-s4HHcMmg.d.cts +207 -0
  44. package/package.json +28 -4
  45. package/dist/compiler-CE-EYxtc.cjs +0 -248
  46. package/dist/compiler-eCuSUgYl.mjs +0 -238
  47. package/dist/evals-api-7CuLOvxe.d.mts +0 -99
  48. package/dist/evals-api-w3tR6UNj.d.cts +0 -99
package/README.md CHANGED
@@ -42,7 +42,7 @@ export const hasGreeting: Validator = async ({ readText }) =>
42
42
  (await readText("hello.txt")) === "hello";
43
43
  ```
44
44
 
45
- Reference it directly from `anpord.eval.ts`:
45
+ Reference it directly from `greeting.eval.ts`:
46
46
 
47
47
  ```ts
48
48
  import { defineEval } from "anpord";
@@ -67,6 +67,41 @@ export default defineEval({
67
67
  npx anpord eval
68
68
  ```
69
69
 
70
+ With no paths, the CLI discovers every `**/*.eval.ts` file and starts the
71
+ suites concurrently. Pass files or directories to run a smaller set.
72
+
73
+ ## Mock MCP servers
74
+
75
+ Define local MCP dependencies once and Anpord gives every OpenCode trial a
76
+ fresh stdio server:
77
+
78
+ ```ts
79
+ import { z } from "zod";
80
+ import { defineEval } from "anpord";
81
+ import { server, tool } from "anpord/mcp";
82
+
83
+ const api = server({
84
+ name: "example",
85
+ version: "1.0.0",
86
+ tools: [
87
+ tool({
88
+ name: "users_get",
89
+ inputSchema: z.object({ id: z.string() }),
90
+ outputSchema: z.object({ id: z.string(), name: z.string() }),
91
+ handler: ({ id }) => ({ id, name: "Ada" }),
92
+ }),
93
+ ],
94
+ });
95
+
96
+ export default defineEval({
97
+ mcp: [api],
98
+ // cases, prompt, tasks, and trials
99
+ });
100
+ ```
101
+
102
+ Handlers return plain values or promises. Validators can inspect exact calls
103
+ with `await context.mcp.calls("example")`. No service credentials are needed.
104
+
70
105
  ## Resolve a prompt
71
106
 
72
107
  ```ts
@@ -0,0 +1,13 @@
1
+ import { Schema } from "effect";
2
+ //#region src/mcp/calls.d.ts
3
+ declare const McpCallSchema: Schema.Struct<{
4
+ error: Schema.optional<typeof Schema.String>;
5
+ input: typeof Schema.Unknown;
6
+ kind: Schema.Literal<["tool", "resource"]>;
7
+ name: typeof Schema.String;
8
+ output: Schema.optional<typeof Schema.Unknown>;
9
+ server: typeof Schema.String;
10
+ }>;
11
+ type McpCall = typeof McpCallSchema.Type;
12
+ //#endregion
13
+ export { McpCall as t };
@@ -0,0 +1,13 @@
1
+ import { Schema } from "effect";
2
+ //#region src/mcp/calls.d.ts
3
+ declare const McpCallSchema: Schema.Struct<{
4
+ error: Schema.optional<typeof Schema.String>;
5
+ input: typeof Schema.Unknown;
6
+ kind: Schema.Literal<["tool", "resource"]>;
7
+ name: typeof Schema.String;
8
+ output: Schema.optional<typeof Schema.Unknown>;
9
+ server: typeof Schema.String;
10
+ }>;
11
+ type McpCall = typeof McpCallSchema.Type;
12
+ //#endregion
13
+ export { McpCall as t };