Skip to content

Commit 0d70d79

Browse files
committed
Add agent workbench package
1 parent 95d84f9 commit 0d70d79

12 files changed

Lines changed: 946 additions & 5 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: agent-workbench Release to npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
defaults:
8+
run:
9+
working-directory: packages/agent-workbench
10+
11+
jobs:
12+
publish:
13+
if: startsWith(github.ref_name, 'agent-workbench-v')
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
checks: read
18+
id-token: write
19+
steps:
20+
- uses: actions/checkout@v6
21+
22+
- uses: actions/setup-node@v6
23+
with:
24+
node-version: '22'
25+
registry-url: 'https://registry.npmjs.org'
26+
cache: 'npm'
27+
28+
- name: Set version from release tag
29+
run: |
30+
VERSION="${GITHUB_REF_NAME#agent-workbench-v}"
31+
echo "VERSION=$VERSION" >> $GITHUB_ENV
32+
33+
- name: Verify required CI passed for release commit
34+
uses: ./.github/actions/verify-release-gate
35+
env:
36+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Verify package.json version matches release tag
39+
run: npm run release:check-source -- "$VERSION"
40+
41+
- name: Install (workspace root)
42+
run: npm ci
43+
working-directory: .
44+
45+
- name: Publish to npm (with provenance)
46+
run: npm publish --provenance --access public
47+
env:
48+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ jobs:
101101
- workspace: "@agent-pattern-labs/iso-guard"
102102
node: "20.6.0"
103103
extra: ""
104+
- workspace: "@agent-pattern-labs/agent-workbench"
105+
node: "20.6.0"
106+
extra: ""
104107
- workspace: "@agent-pattern-labs/agentmd"
105108
node: "22.0.0"
106109
extra: ""

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Today, agent workflow reliability is fragmented on three axes:
3535
"what already happened." Those invariants belong in deterministic local packages,
3636
not in repeatedly re-tokenized instructions.
3737

38-
Twenty-five packages solve that in one pipeline with runtime control and a
38+
Twenty-six packages solve that in one pipeline with runtime control and a
3939
feedback loop:
4040

4141
- **Four build-time tools** turn your authored source into every harness's file layout:
@@ -87,6 +87,11 @@ feedback loop:
8787
[`@agent-pattern-labs/iso-eval`](./packages/iso-eval) scores *did the agent complete the task?* and
8888
[`@agent-pattern-labs/iso-trace`](./packages/iso-trace) parses production transcripts to show *what the agent actually did*,
8989
while [`@agent-pattern-labs/iso-guard`](./packages/iso-guard) enforces operational policies against those event streams.
90+
- **One local operator workbench** helps you see the harness fleet you already
91+
have on disk: [`@agent-pattern-labs/agent-workbench`](./packages/agent-workbench)
92+
discovers ISO, JobForge, leads-rig, and ProfileScribe harness projects and
93+
summarizes scripts, MCP config, generated harness files, ledgers, caches, and
94+
traces.
9095

9196
```
9297
authoring build output feedback
@@ -263,7 +268,7 @@ of the prompt:
263268
- `iso-guard` audits the normalized event streams from real runs so runtime
264269
policy stays verifiable after deploy.
265270

266-
## Packages (25 Total)
271+
## Packages (26 Total)
267272

268273
1. **[`packages/iso`](./packages/iso)**[`@agent-pattern-labs/iso`](https://www.npmjs.com/package/@agent-pattern-labs/iso) · *recommended entry point*
269274
The wrapper CLI for the whole flow. If `agent.md` is your authored
@@ -438,6 +443,12 @@ of the prompt:
438443
packages can move invariants out of prompt prose and shell scripts.
439444
Library-first today: no CLI, no harness-specific task-dispatch adapter.
440445

446+
26. **[`packages/agent-workbench`](./packages/agent-workbench)**[`@agent-pattern-labs/agent-workbench`](https://www.npmjs.com/package/@agent-pattern-labs/agent-workbench)
447+
Local operator workbench for ISO-based agent harness projects. Discovers
448+
harnesses on disk, classifies JobForge/leads-rig/ProfileScribe/ISO projects,
449+
and summarizes scripts, MCP servers, generated harness config, ledgers,
450+
caches, traces, and attention items before you choose the next command.
451+
441452
Each package is independently published on npm and works on its own.
442453
They're in one repo because they're designed to compose.
443454

@@ -729,7 +740,8 @@ iso/
729740
├── iso-redact/ # deterministic sensitive-data redaction
730741
├── iso-migrate/ # deterministic consumer project migrations
731742
├── iso-contract/ # deterministic artifact contracts
732-
└── iso-capabilities/ # deterministic role capability policy
743+
├── iso-capabilities/ # deterministic role capability policy
744+
└── agent-workbench/ # local operator view across harness projects
733745
```
734746
735747
## Build & test
@@ -758,6 +770,7 @@ npm --workspace @agent-pattern-labs/iso-lineage run test # iso-lineage artifa
758770
npm --workspace @agent-pattern-labs/iso-preflight run test # iso-preflight dispatch planning tests
759771
npm --workspace @agent-pattern-labs/iso-postflight run test # iso-postflight settlement tests
760772
npm --workspace @agent-pattern-labs/iso-redact run test # iso-redact policy/redaction tests
773+
npm --workspace @agent-pattern-labs/agent-workbench run test # local workbench discovery tests
761774
npm --workspace @agent-pattern-labs/iso-migrate run test # iso-migrate project migration tests
762775
npm --workspace @agent-pattern-labs/iso-contract run test # iso-contract artifact contract tests
763776
npm --workspace @agent-pattern-labs/iso-capabilities run test # iso-capabilities policy tests
@@ -815,7 +828,7 @@ downstream repo would use.
815828
816829
`npm run test:pack` goes one level further: it packs the local workspaces into
817830
tarballs, installs them into fresh temp projects, and smoke-tests the packaged
818-
`iso-harness`, `iso`, `iso-eval`, `iso-trace`, `iso-route`, `iso-guard`, `iso-ledger`, `iso-context`, `iso-cache`, `iso-index`, `iso-facts`, `iso-canon`, `iso-score`, `iso-timeline`, `iso-prioritize`, `iso-lineage`, `iso-preflight`, `iso-postflight`, `iso-redact`, `iso-migrate`, `iso-contract`, and `iso-capabilities`
831+
`iso-harness`, `iso`, `iso-eval`, `iso-trace`, `iso-route`, `iso-guard`, `iso-ledger`, `iso-context`, `iso-cache`, `iso-index`, `iso-facts`, `iso-canon`, `iso-score`, `iso-timeline`, `iso-prioritize`, `iso-lineage`, `iso-preflight`, `iso-postflight`, `iso-redact`, `iso-migrate`, `iso-contract`, `iso-capabilities`, and `agent-workbench`
819832
CLIs. This guards against packaging regressions that workspace-only tests can
820833
miss.
821834

package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/agent-workbench/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Razroo
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.

packages/agent-workbench/README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# @agent-pattern-labs/agent-workbench
2+
3+
Local operator workbench for ISO-based agent harness projects.
4+
5+
`agent-workbench` discovers harness projects on disk and summarizes the
6+
configuration, scripts, MCP servers, and local state files an operator usually
7+
needs before deciding what to run next.
8+
9+
## Install
10+
11+
```bash
12+
npm install -D @agent-pattern-labs/agent-workbench
13+
```
14+
15+
Or run it ad hoc:
16+
17+
```bash
18+
npx @agent-pattern-labs/agent-workbench scan ~/AgentPatternLabs
19+
```
20+
21+
## CLI
22+
23+
```bash
24+
agent-workbench scan [root] [--max-depth 3] [--json]
25+
agent-workbench status [project] [--json]
26+
agent-workbench doctor [root] [--max-depth 3] [--json]
27+
```
28+
29+
`scan` is the default command:
30+
31+
```bash
32+
agent-workbench ~/AgentPatternLabs
33+
```
34+
35+
The scanner recognizes:
36+
37+
- ISO projects with `agent.md`, `iso/`, `models.yaml`, or generated harness files.
38+
- JobForge projects and packages.
39+
- `@agent-pattern-labs/leads-rig` projects and packages.
40+
- `@agent-pattern-labs/profile-scribe-rig` projects and packages.
41+
- Generic package workspaces that depend on ISO or Agent Pattern Labs packages.
42+
43+
## Library API
44+
45+
```js
46+
import {
47+
discoverProjects,
48+
readProjectStatus,
49+
summarizeWorkspace,
50+
formatSummary,
51+
} from '@agent-pattern-labs/agent-workbench';
52+
53+
const summary = summarizeWorkspace('/Users/charlie/AgentPatternLabs');
54+
console.log(formatSummary(summary));
55+
```
56+
57+
## What It Checks
58+
59+
For each discovered project, the workbench reports:
60+
61+
- project kind and package name
62+
- common operational scripts such as `verify`, `smoke:iso`, `build:config`,
63+
`trace:list`, and `guard:audit`
64+
- agent/harness markers such as `AGENTS.md`, `agent.md`, `iso/`,
65+
`models.yaml`, `.codex/config.toml`, `.mcp.json`, and `opencode.json`
66+
- MCP server names found in JSON MCP config or Codex TOML config
67+
- local event ledgers, cache directories, and trace-like directories
68+
69+
The package is intentionally local-only. It does not upload traces, read
70+
secrets, or call model APIs.
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
#!/usr/bin/env node
2+
import {
3+
formatDoctor,
4+
formatProjectStatus,
5+
formatSummary,
6+
readProjectStatus,
7+
summarizeWorkspace,
8+
} from '../src/index.mjs';
9+
10+
function printHelp() {
11+
console.log(`agent-workbench
12+
13+
Usage:
14+
agent-workbench scan [root] [--max-depth 3] [--json]
15+
agent-workbench status [project] [--json]
16+
agent-workbench doctor [root] [--max-depth 3] [--json]
17+
agent-workbench --help
18+
agent-workbench --version
19+
`);
20+
}
21+
22+
function parseArgs(argv) {
23+
const args = [...argv];
24+
let command = 'scan';
25+
let target = null;
26+
let json = false;
27+
let maxDepth = 3;
28+
29+
if (args[0] && !args[0].startsWith('-')) {
30+
command = args.shift();
31+
}
32+
33+
for (let i = 0; i < args.length; i += 1) {
34+
const arg = args[i];
35+
if (arg === '--json') {
36+
json = true;
37+
continue;
38+
}
39+
if (arg === '--max-depth') {
40+
const value = args[i + 1];
41+
if (!value) {
42+
throw new Error('--max-depth requires a value');
43+
}
44+
maxDepth = Number(value);
45+
i += 1;
46+
continue;
47+
}
48+
if (arg.startsWith('--max-depth=')) {
49+
maxDepth = Number(arg.slice('--max-depth='.length));
50+
continue;
51+
}
52+
if (arg === '--help' || arg === '-h') {
53+
command = 'help';
54+
continue;
55+
}
56+
if (arg === '--version' || arg === '-v') {
57+
command = 'version';
58+
continue;
59+
}
60+
if (arg.startsWith('-')) {
61+
throw new Error(`unknown option: ${arg}`);
62+
}
63+
if (target) {
64+
throw new Error(`unexpected argument: ${arg}`);
65+
}
66+
target = arg;
67+
}
68+
69+
if (!Number.isInteger(maxDepth) || maxDepth < 0) {
70+
throw new Error('--max-depth must be a non-negative integer');
71+
}
72+
73+
return { command, target, json, maxDepth };
74+
}
75+
76+
function main() {
77+
const { command, target, json, maxDepth } = parseArgs(process.argv.slice(2));
78+
79+
if (command === 'help') {
80+
printHelp();
81+
return;
82+
}
83+
84+
if (command === 'version') {
85+
console.log('0.1.0');
86+
return;
87+
}
88+
89+
if (command === 'status') {
90+
const status = readProjectStatus(target ?? process.cwd());
91+
console.log(json ? JSON.stringify(status, null, 2) : formatProjectStatus(status));
92+
return;
93+
}
94+
95+
if (command === 'scan') {
96+
const summary = summarizeWorkspace(target ?? process.cwd(), { maxDepth });
97+
console.log(json ? JSON.stringify(summary, null, 2) : formatSummary(summary));
98+
return;
99+
}
100+
101+
if (command === 'doctor') {
102+
const summary = summarizeWorkspace(target ?? process.cwd(), { maxDepth });
103+
console.log(json ? JSON.stringify(summary.attention, null, 2) : formatDoctor(summary));
104+
return;
105+
}
106+
107+
throw new Error(`unknown command: ${command}`);
108+
}
109+
110+
try {
111+
main();
112+
} catch (error) {
113+
console.error(`agent-workbench: ${error.message}`);
114+
process.exit(2);
115+
}

0 commit comments

Comments
 (0)