anpord 0.1.8 → 0.1.10
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 +35 -2
- package/dist/bin.cjs +914 -0
- package/dist/bin.d.cts +1 -0
- package/dist/bin.d.mts +1 -0
- package/dist/bin.mjs +915 -0
- package/dist/calls-Drj_dZpu.d.cts +12 -0
- package/dist/calls-Drj_dZpu.d.mts +12 -0
- package/dist/cli-runtime.cjs +131 -0
- package/dist/cli-runtime.d.cts +11 -0
- package/dist/cli-runtime.d.mts +11 -0
- package/dist/cli-runtime.mjs +129 -0
- package/dist/cli.cjs +4 -914
- package/dist/cli.d.cts +3 -1
- package/dist/cli.d.mts +3 -1
- package/dist/cli.mjs +2 -915
- package/dist/{compiler-Dj-0uzC6.mjs → compiler-CKnNV-Ct.mjs} +218 -74
- package/dist/{compiler-DpQHrrv6.cjs → compiler-aFvZixb7.cjs} +218 -74
- package/dist/define-Bh3A5AZv.cjs +47 -0
- package/dist/define-Chq7EOpT.mjs +30 -0
- package/dist/define-Dxk8YZ4T.d.cts +39 -0
- package/dist/define-Dxk8YZ4T.d.mts +39 -0
- package/dist/eval.cjs +1 -1
- package/dist/eval.d.cts +2 -2
- package/dist/eval.d.mts +2 -2
- package/dist/eval.mjs +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.mts +3 -2
- package/dist/mcp.cjs +3 -1
- package/dist/mcp.mjs +3 -1
- package/dist/{types-s4HHcMmg.d.cts → types-BFF8MwhF.d.cts} +6 -0
- package/dist/{types-CtIaEg8h.d.mts → types-DPDjM69Q.d.mts} +6 -0
- package/package.json +24 -2
package/README.md
CHANGED
|
@@ -72,8 +72,8 @@ suites concurrently. Pass files or directories to run a smaller set.
|
|
|
72
72
|
|
|
73
73
|
## Mock MCP servers
|
|
74
74
|
|
|
75
|
-
Define local MCP dependencies once and Anpord gives every
|
|
76
|
-
fresh stdio server:
|
|
75
|
+
Define local MCP dependencies once and Anpord gives every built-in agent trial
|
|
76
|
+
a fresh stdio server:
|
|
77
77
|
|
|
78
78
|
```ts
|
|
79
79
|
import { z } from "zod";
|
|
@@ -102,6 +102,39 @@ export default defineEval({
|
|
|
102
102
|
Handlers return plain values or promises. Validators can inspect exact calls
|
|
103
103
|
with `await context.mcp.calls("example")`. No service credentials are needed.
|
|
104
104
|
|
|
105
|
+
## Mock CLIs
|
|
106
|
+
|
|
107
|
+
Define a local executable with the same Standard Schema fixtures and attach it
|
|
108
|
+
to any eval:
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
import { z } from "zod";
|
|
112
|
+
import { defineEval } from "anpord";
|
|
113
|
+
import { cli, command } from "anpord/cli";
|
|
114
|
+
|
|
115
|
+
const client = cli({
|
|
116
|
+
name: "example",
|
|
117
|
+
version: "1.0.0",
|
|
118
|
+
commands: [
|
|
119
|
+
command({
|
|
120
|
+
name: "users get",
|
|
121
|
+
inputSchema: z.object({ id: z.string() }),
|
|
122
|
+
outputSchema: z.object({ id: z.string(), name: z.string() }),
|
|
123
|
+
options: { id: { type: "string" } },
|
|
124
|
+
handler: ({ id }) => ({ id, name: "Ada" }),
|
|
125
|
+
}),
|
|
126
|
+
],
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
export default defineEval({
|
|
130
|
+
cli: [client],
|
|
131
|
+
// cases, prompt, tasks, and trials
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Every built-in agent receives the executable on `PATH`. Validators can inspect
|
|
136
|
+
calls with `await context.cli.calls("example")`.
|
|
137
|
+
|
|
105
138
|
## Resolve a prompt
|
|
106
139
|
|
|
107
140
|
```ts
|