oh-my-promptfoo 0.0.0-stage → 1.6.0
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/LICENSE +21 -0
- package/README.md +105 -2
- package/dist/cli.js +2979 -0
- package/dist/cli.js.map +1 -0
- package/dist/delegate-runner.js +7086 -0
- package/dist/delegate-runner.js.map +1 -0
- package/dist/index.cjs +6973 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +245 -0
- package/dist/index.d.ts +245 -0
- package/dist/index.js +7017 -0
- package/dist/index.js.map +1 -0
- package/package.json +44 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 allagentsdev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,106 @@
|
|
|
1
|
-
#
|
|
1
|
+
# oh-my-promptfoo
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Run coding-agent evaluations with stock Promptfoo. This package provides two entry points:
|
|
4
|
+
|
|
5
|
+
If you installed `@allagents/promptfoo-x` or `@allagents/promptfoo-integration`, switch the install name and `package:` provider IDs to `oh-my-promptfoo`. Existing workspace caches remain compatible.
|
|
6
|
+
|
|
7
|
+
| Use case | Promptfoo provider |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| Create a private writable workspace, optionally seeded from Git or OCI, then run Codex, Claude, or Copilot in it | `package:oh-my-promptfoo:Provider` |
|
|
10
|
+
| Run Copilot in an existing directory that you manage | `package:oh-my-promptfoo:CopilotSdkProvider` |
|
|
11
|
+
|
|
12
|
+
`Provider` owns the workspace for each evaluation row. `CopilotSdkProvider` uses your existing directory. Both return results to ordinary Promptfoo assertions; the package does not grade responses.
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
Requires Node 22.22+, Linux, macOS, or Windows, and Promptfoo 0.122.x. On Windows, workspace cache locks and process identity require the system Windows PowerShell executable.
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm install --save-dev promptfoo@0.122.0 oh-my-promptfoo
|
|
20
|
+
# Add this only if you use Copilot, directly or as a workspace delegate:
|
|
21
|
+
npm install --save-dev @github/copilot-sdk@1.0.6
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Set the credential for the agent you select before running an evaluation. OCI sources also require an ORAS 1.x executable supplied through `ALLAGENTS_ORAS_PATH`.
|
|
25
|
+
|
|
26
|
+
## Prepare a workspace and run an agent
|
|
27
|
+
|
|
28
|
+
`Provider` creates a separate writable workspace for each test. `delegate.id` selects the agent; `workspace.sources` places Git or OCI content in that workspace. Use `sources: []` when the agent needs an empty workspace.
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
# promptfooconfig.yaml
|
|
32
|
+
prompts: ["{{task}}"]
|
|
33
|
+
providers:
|
|
34
|
+
- id: package:oh-my-promptfoo:Provider
|
|
35
|
+
config:
|
|
36
|
+
delegate:
|
|
37
|
+
id: openai:codex-sdk
|
|
38
|
+
config:
|
|
39
|
+
model: gpt-5.3-codex
|
|
40
|
+
sandbox_mode: workspace-write
|
|
41
|
+
env:
|
|
42
|
+
OPENAI_API_KEY: "{{env.OPENAI_API_KEY}}"
|
|
43
|
+
workspace:
|
|
44
|
+
sources:
|
|
45
|
+
- type: git
|
|
46
|
+
repository: https://github.com/allagentsdev/oh-my-promptfoo.git
|
|
47
|
+
ref: main
|
|
48
|
+
destination: project
|
|
49
|
+
workingDir: project
|
|
50
|
+
tests:
|
|
51
|
+
- vars:
|
|
52
|
+
task: Read README.md and write a summary to summary.txt in this repository.
|
|
53
|
+
assert:
|
|
54
|
+
- type: javascript
|
|
55
|
+
value: |
|
|
56
|
+
return import('node:fs').then(fs => {
|
|
57
|
+
const root = context.providerResponse.metadata.workspace.path;
|
|
58
|
+
return fs.readFileSync(root + '/project/summary.txt', 'utf8').length > 0;
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
npx promptfoo eval --config promptfooconfig.yaml
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The workspace stays available while Promptfoo runs assertions. `metadata.workspace.path` is a transient local path, not a durable artifact. For Codex, Claude, and Copilot variants, see the [workspace examples](https://github.com/allagentsdev/oh-my-promptfoo/tree/main/examples).
|
|
67
|
+
|
|
68
|
+
## Run Copilot in an existing directory
|
|
69
|
+
|
|
70
|
+
`CopilotSdkProvider` runs Copilot in an existing `working_dir`. Set `COPILOT_WORKING_DIR` to an absolute path. This provider does not prepare Git or OCI sources.
|
|
71
|
+
|
|
72
|
+
```yaml
|
|
73
|
+
# promptfooconfig.yaml
|
|
74
|
+
prompts: ["{{task}}"]
|
|
75
|
+
providers:
|
|
76
|
+
- id: package:oh-my-promptfoo:CopilotSdkProvider
|
|
77
|
+
config:
|
|
78
|
+
working_dir: "{{env.COPILOT_WORKING_DIR}}"
|
|
79
|
+
env:
|
|
80
|
+
COPILOT_GITHUB_TOKEN: "{{env.COPILOT_GITHUB_TOKEN}}"
|
|
81
|
+
tests:
|
|
82
|
+
- vars:
|
|
83
|
+
task: Explain the purpose of this repository.
|
|
84
|
+
assert:
|
|
85
|
+
- type: regex
|
|
86
|
+
value: .+
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Copilot's default permissions deny writes, shell, and network. Set `config.permissions` explicitly when a test needs them. The [direct Copilot example](https://github.com/allagentsdev/oh-my-promptfoo/blob/main/examples/copilot/promptfooconfig.yaml) shows write permission.
|
|
90
|
+
|
|
91
|
+
Run this configuration with `npx promptfoo eval --config promptfooconfig.yaml` after setting `COPILOT_WORKING_DIR` and `COPILOT_GITHUB_TOKEN`.
|
|
92
|
+
|
|
93
|
+
## Configuration at a glance
|
|
94
|
+
|
|
95
|
+
| Field | Applies to | Meaning |
|
|
96
|
+
| --- | --- | --- |
|
|
97
|
+
| `config.delegate.id` | `Provider` | Required: `openai:codex-sdk`, `anthropic:claude-agent-sdk`, or `copilot-sdk` |
|
|
98
|
+
| `config.delegate.config` | `Provider` | Agent-specific settings, such as model and sandbox mode |
|
|
99
|
+
| `config.delegate.env` | `Provider` | Explicit credentials passed to the delegated agent |
|
|
100
|
+
| `config.workspace.sources` | `Provider` | Required array of Git or OCI sources; `[]` creates an empty workspace |
|
|
101
|
+
| `config.workingDir` | `Provider` | Optional relative directory inside the prepared workspace; defaults to its root |
|
|
102
|
+
| `config.fileChanges` | `Provider` | Optional bounded file-change evidence; defaults to `false` |
|
|
103
|
+
| `config.working_dir` | `CopilotSdkProvider` | Required existing directory |
|
|
104
|
+
| `config.env`, `config.permissions` | `CopilotSdkProvider` | Explicit Copilot credentials and permissions |
|
|
105
|
+
|
|
106
|
+
Promptfoo's `package:` reference needs the exported class suffix shown above; the npm package name alone is not a provider ID. See the [provider guide](https://github.com/allagentsdev/oh-my-promptfoo/blob/main/docs/provider-guide.md) for source permissions, response metadata, cleanup, caching, and full configuration details.
|