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 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 OpenCode trial a
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