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.
- package/README.md +36 -1
- package/dist/calls-DYqBi5FA.d.cts +13 -0
- package/dist/calls-DYqBi5FA.d.mts +13 -0
- package/dist/cli.cjs +621 -62
- package/dist/cli.mjs +621 -62
- package/dist/{client-D0Rd_z6s.mjs → client-5K3dMI5Q.mjs} +236 -120
- package/dist/client-C9m0uLCz.d.cts +3518 -0
- package/dist/{client-Dy5oayYb.cjs → client-Ci0woWLW.cjs} +236 -120
- package/dist/client-TFCLuMv8.d.mts +3518 -0
- package/dist/compiler-Dj-0uzC6.mjs +586 -0
- package/dist/compiler-DpQHrrv6.cjs +597 -0
- package/dist/config.cjs +5 -1
- package/dist/config.d.cts +5 -2
- package/dist/config.d.mts +5 -2
- package/dist/config.mjs +5 -3
- package/dist/define-HK0eeSNn.d.cts +48 -0
- package/dist/define-HK0eeSNn.d.mts +48 -0
- package/dist/errors-BK3f7Rdr.d.cts +37 -0
- package/dist/errors-BK3f7Rdr.d.mts +37 -0
- package/dist/eval.cjs +1 -1
- package/dist/eval.d.cts +96 -3
- package/dist/eval.d.mts +96 -3
- package/dist/eval.mjs +1 -1
- package/dist/{source-DZEcNQVL.d.cts → evals-BEgEmfiO.d.cts} +137 -16
- package/dist/{source-DZEcNQVL.d.mts → evals-BEgEmfiO.d.mts} +137 -16
- package/dist/harness-profile-BMjsN460.mjs +43 -0
- package/dist/harness-profile-CDQpPLPd.cjs +78 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +8 -2865
- package/dist/index.d.mts +8 -2865
- package/dist/index.mjs +1 -1
- package/dist/mcp-runtime.cjs +111 -0
- package/dist/mcp-runtime.d.cts +7 -0
- package/dist/mcp-runtime.d.mts +7 -0
- package/dist/mcp-runtime.mjs +109 -0
- package/dist/mcp.cjs +32 -0
- package/dist/mcp.d.cts +3 -0
- package/dist/mcp.d.mts +3 -0
- package/dist/mcp.mjs +29 -0
- package/dist/source.d.cts +6 -1
- package/dist/source.d.mts +6 -1
- package/dist/types-CtIaEg8h.d.mts +207 -0
- package/dist/types-s4HHcMmg.d.cts +207 -0
- package/package.json +28 -4
- package/dist/compiler-CE-EYxtc.cjs +0 -248
- package/dist/compiler-eCuSUgYl.mjs +0 -238
- package/dist/evals-api-7CuLOvxe.d.mts +0 -99
- 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 `
|
|
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 };
|