@cogitator-ai/cli 0.14.0 → 0.15.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/README.md CHANGED
@@ -63,6 +63,7 @@ cogitator run -m ollama/llama3.1:8b "What is the capital of France?"
63
63
  | `cogitator logs` | View Docker Compose service logs |
64
64
  | `cogitator deploy` | Deploy with Docker or Fly.io (see [`@cogitator-ai/deploy`](https://www.npmjs.com/package/@cogitator-ai/deploy)) |
65
65
  | `cogitator rewind` | Rewind a thread's conversation, memory and files to an entry, a dry run first |
66
+ | `cogitator plugin <cmd>` | Install, update, enable, disable and validate plugins and marketplaces, run plugin evals (experimental) |
66
67
 
67
68
  Every command ends with examples in its `--help`.
68
69
 
@@ -293,6 +294,40 @@ Loads the runtime and agents the registry exports (`src/cogitator.ts`, `--regist
293
294
 
294
295
  ---
295
296
 
297
+ ### cogitator plugin
298
+
299
+ Manage [plugins](https://cogitator.app/docs/core/plugins) in the format of Claude Code's plugins and the marketplaces they come from (experimental). Plugins are kept under `COGITATOR_PLUGINS_DIR` (default `~/.cogitator/plugins`), and every install is pinned to the exact commit, npm version and integrity or archive digest it fetched.
300
+
301
+ ```bash
302
+ cogitator plugin marketplace add your-org/claude-plugins
303
+ cogitator plugin install formatter@your-org --scope project
304
+ cogitator plugin install npm:@acme/review-kit@^2.0.0
305
+ cogitator plugin install git+https://git.example.com/tools.git#v1.2.0
306
+ cogitator plugin configure formatter@your-org --set endpoint=https://x.example --secret token
307
+ cogitator plugin list --json
308
+ cogitator plugin update
309
+ cogitator plugin disable formatter@your-org
310
+ cogitator plugin uninstall formatter@your-org --prune --yes
311
+ cogitator plugin validate ./my-plugin --strict
312
+ cogitator plugin eval ./my-plugin
313
+ ```
314
+
315
+ | Subcommand | Description |
316
+ | --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
317
+ | `install <plugin>` (`i`) | From a marketplace (`name@marketplace`), npm (`npm:<package>[@version]`) or git (`git+<url>[#ref]`, `github:<owner>/<repo>[#ref]`). `-s, --scope user\|project\|local` picks the settings file that enables it, `--config key=value` sets options, `--secret key` reads a secret from the terminal, `--marketplace <source>` adds the marketplace first, `-y, --yes` grants the permissions the plugin asks for and runs a `command` source without asking |
318
+ | `uninstall <plugin>` (`remove`, `rm`) | Removes its files, data (`--keep-data` keeps it), options, secrets and `enabledPlugins` entries, `--prune` also the dependencies nothing needs. Refused while an installed plugin depends on it |
319
+ | `enable <plugin>`, `disable <plugin>` | Writes `enabledPlugins` of the scope, without `--scope` of the settings file that decides now (local, project, user), else the user's, and warns when a higher layer still decides otherwise. Enabling needs the dependencies installed, disabling is refused while an enabled plugin depends on it, managed settings win |
320
+ | `update [plugin]` | Fetches the source again and installs a new version only when its version changed |
321
+ | `list` | The installed plugins, enabled or not, with load errors. `--available --json` adds what the marketplaces offer |
322
+ | `configure <plugin>` | `--set key=value`, `--secret key`, `--unset key` |
323
+ | `validate <path>` | As `claude plugin validate`: exit 0 passed, 1 failed, 2 when the check itself failed, `--strict` fails on warnings |
324
+ | `marketplace add <source>`, `list`, `remove <name>` (`rm`), `update [name]` | `owner/repo`, a git URL, an https link to a `marketplace.json` or a local folder or file |
325
+ | `eval [target]` | Runs the plugin's eval cases in the format of `claude plugin eval`, with and without the plugin, and prints `CASE WITH W/OUT Δ RUNS COST NOTES`. `--runs`, `-j, --concurrency`, `--model`, `--judge-model`, `--ablation none\|with-without`, `--threshold`, `--max-cost-usd`, `--allow-tools`, `--scaffold`, `--case`, `--tag`, `--eval-dir`, `--json [path]`, `--output-dir`, `--keep-temp`, `--verbose`, and Claude Code's `--trust-plugin`, `--no-publish`, `--publish-report` and `--mocks record`, which change nothing. See [Plugin evals](https://cogitator.app/docs/evals/plugin-evals) |
326
+
327
+ Every subcommand that changes something takes `--json` and then prints one object with `command`, `outcome` (`ok` or `failed`), `message` and, on a failure, `failureCode`.
328
+
329
+ `plugin eval` writes `aggregate-result.json` and a self-contained `report.html` under `<eval dir>/results/<timestamp>/` and exits as `claude plugin eval` does: `0` when every case met `--threshold`, `1` for a case below it, a case that failed to load or a run that ended on a provider error, `2` for a partial run (the `--max-cost-usd` ceiling), `130` when interrupted and `143` when terminated. A command-line error (an unknown option, a wrong value) exits `1`, not `2`, and `--mocks off` and `--allow-real-servers` exit `1` since real plugin MCP servers are not started. `--json` prints its result document instead of the object above.
330
+
296
331
  ### cogitator skill
297
332
 
298
333
  ```bash
@@ -377,6 +412,7 @@ The model, memory and `deploy:` section all come from one config file: the `-c`
377
412
  | ------------------------------------------------------- | ------------------------- | ----------------------------------- |
378
413
  | `COGITATOR_CONFIG` | `run` | Config file path |
379
414
  | `COGITATOR_MODEL` | `run` | Default model |
415
+ | `COGITATOR_PLUGINS_DIR` | `plugin`, runtime | Where installed plugins are kept |
380
416
  | `OLLAMA_URL` / `OLLAMA_HOST` | `run`, `models`, `status` | Ollama endpoint |
381
417
  | `OLLAMA_API_KEY` | `run`, `models`, `wizard` | Ollama Cloud / authenticated Ollama |
382
418
  | `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY` | `run`, `init`, `wizard` | Provider keys |
@@ -0,0 +1,63 @@
1
+ import { Command, type CommanderError } from 'commander';
2
+ import { type PluginEvalCaseResult, type PluginEvalOptions, type PluginEvalReport, type PluginEvalResult } from '@cogitator-ai/evals';
3
+ /** Exit codes of `cogitator plugin eval`, as Claude Code's `claude plugin eval` uses them */
4
+ export declare const PLUGIN_EVAL_EXIT: {
5
+ readonly passed: 0;
6
+ readonly failed: 1;
7
+ readonly partial: 2;
8
+ readonly interrupted: 130;
9
+ readonly terminated: 143;
10
+ };
11
+ export interface PluginEvalFlags {
12
+ runs?: string;
13
+ concurrency?: string;
14
+ model?: string;
15
+ judgeModel?: string;
16
+ ablation?: string;
17
+ threshold?: string;
18
+ maxCostUsd?: string;
19
+ allowTools?: string[];
20
+ scaffold?: boolean;
21
+ case?: string;
22
+ tag?: string[];
23
+ evalDir?: string;
24
+ json?: boolean | string;
25
+ outputDir?: string;
26
+ keepTemp?: boolean;
27
+ verbose?: boolean;
28
+ config?: string;
29
+ /** Accepted for Claude Code's command lines: there is no trust prompt */
30
+ trustPlugin?: boolean;
31
+ /** `--no-publish` sets it false. Accepted for Claude Code's command lines: the report stays local */
32
+ publish?: boolean;
33
+ /** Accepted for Claude Code's command lines: the report stays local */
34
+ publishReport?: boolean;
35
+ /** `record` only: mocked MCP tools answer from their files */
36
+ mocks?: string;
37
+ allowRealServers?: boolean;
38
+ }
39
+ /** What `runPluginEval` runs the suite with, replaceable in tests */
40
+ export interface PluginEvalDependencies {
41
+ run: (options: PluginEvalOptions) => Promise<PluginEvalReport>;
42
+ env: NodeJS.ProcessEnv;
43
+ }
44
+ /** The options of the suite run: the flags, and the LLM configuration of the project and env */
45
+ export declare function pluginEvalOptions(target: string | undefined, flags: PluginEvalFlags, env: NodeJS.ProcessEnv): PluginEvalOptions;
46
+ /** The highest-weight failing grader's explanation, or the run's error, from the with-arm */
47
+ export declare function caseNote(result: PluginEvalCaseResult): string;
48
+ /** The summary table: `CASE WITH W/OUT Δ RUNS COST NOTES`, or `SCORE PASS%` when no case has a baseline */
49
+ export declare function summaryLines(result: PluginEvalResult): string[];
50
+ /** Runs a plugin's eval suite and resolves with the exit code */
51
+ export declare function runPluginEval(target: string | undefined, flags: PluginEvalFlags, dependencies?: PluginEvalDependencies): Promise<number>;
52
+ /**
53
+ * A command whose command-line errors (an unknown option, a missing or wrong value) exit 1 as
54
+ * `CommandError`s: exit 2 means a partial run for `claude plugin eval`, so it is never a usage error
55
+ * here. Commander's own message is not printed, the entry point reports the error once
56
+ */
57
+ declare class PluginEvalCommand extends Command {
58
+ exitOverride(callback?: (error: CommanderError) => void): this;
59
+ }
60
+ /** `eval`: runs the eval cases of a plugin, mounted under `cogitator plugin` */
61
+ export declare const pluginEvalCommand: PluginEvalCommand;
62
+ export {};
63
+ //# sourceMappingURL=plugin-eval.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-eval.d.ts","sourceRoot":"","sources":["../../src/commands/plugin-eval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAIzD,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EAEtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EAEtB,MAAM,qBAAqB,CAAC;AAI7B,6FAA6F;AAC7F,eAAO,MAAM,gBAAgB;;;;;;CAMnB,CAAC;AAEX,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qGAAqG;IACrG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uEAAuE;IACvE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,qEAAqE;AACrE,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC/D,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;CACxB;AA0CD,gGAAgG;AAChG,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,eAAe,EACtB,GAAG,EAAE,MAAM,CAAC,UAAU,GACrB,iBAAiB,CAuDnB;AAoBD,6FAA6F;AAC7F,wBAAgB,QAAQ,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAU7D;AAaD,2GAA2G;AAC3G,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,EAAE,CA+B/D;AA+ED,iEAAiE;AACjE,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,eAAe,EACtB,YAAY,GAAE,sBAA6C,GAC1D,OAAO,CAAC,MAAM,CAAC,CAyCjB;AAED;;;;GAIG;AACH,cAAM,iBAAkB,SAAQ,OAAO;IAC5B,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CASxE;AAED,gFAAgF;AAChF,eAAO,MAAM,iBAAiB,mBA8E1B,CAAC"}
@@ -0,0 +1,348 @@
1
+ import { Command } from 'commander';
2
+ import chalk from 'chalk';
3
+ import { writeFileSync } from 'node:fs';
4
+ import { resolve } from 'node:path';
5
+ import { experimental_runPluginEvals, PluginEvalError, } from '@cogitator-ai/evals';
6
+ import { CommandError, examplesHelp, reportFailure } from '../utils/cli.js';
7
+ import { findConfig, loadRunConfig } from '../utils/run-config.js';
8
+ /** Exit codes of `cogitator plugin eval`, as Claude Code's `claude plugin eval` uses them */
9
+ export const PLUGIN_EVAL_EXIT = {
10
+ passed: 0,
11
+ failed: 1,
12
+ partial: 2,
13
+ interrupted: 130,
14
+ terminated: 143,
15
+ };
16
+ const DEFAULT_DEPENDENCIES = {
17
+ run: experimental_runPluginEvals,
18
+ env: process.env,
19
+ };
20
+ function integer(value, flag, min, max) {
21
+ if (value === undefined)
22
+ return undefined;
23
+ const parsed = Number(value);
24
+ if (!Number.isInteger(parsed) || parsed < min || parsed > max) {
25
+ throw new CommandError(`${flag} takes a whole number from ${min} to ${max}, got ${value}`);
26
+ }
27
+ return parsed;
28
+ }
29
+ function decimal(value, flag, min, max) {
30
+ if (value === undefined)
31
+ return undefined;
32
+ const parsed = Number(value);
33
+ if (value.trim() === '' || !Number.isFinite(parsed) || parsed < min || parsed > max) {
34
+ const range = max === Infinity ? `${min} or more` : `from ${min} to ${max}`;
35
+ throw new CommandError(`${flag} takes a number ${range}, got ${value}`);
36
+ }
37
+ return parsed;
38
+ }
39
+ function ablationOf(value) {
40
+ if (value === undefined)
41
+ return undefined;
42
+ if (value === 'none' || value === 'with-without')
43
+ return value;
44
+ throw new CommandError(`--ablation takes none or with-without, got ${value}`);
45
+ }
46
+ /** The options of the suite run: the flags, and the LLM configuration of the project and env */
47
+ export function pluginEvalOptions(target, flags, env) {
48
+ const realServers = "real plugin MCP servers are not started by Cogitator's plugin evals: mock their tools under mocks/<server>/<tool>.md";
49
+ if (flags.mocks !== undefined && flags.mocks !== 'record') {
50
+ throw new CommandError(flags.mocks === 'off'
51
+ ? `--mocks off is not supported, ${realServers}`
52
+ : `--mocks takes record, got ${flags.mocks}`);
53
+ }
54
+ if (flags.allowRealServers) {
55
+ throw new CommandError(`--allow-real-servers is not supported, ${realServers}`);
56
+ }
57
+ if (typeof flags.json === 'string' && !flags.json.endsWith('.json')) {
58
+ throw new CommandError(`--json output path must end in .json, got ${flags.json}`, {
59
+ hints: ['Put the target before --json, as in: cogitator plugin eval . --json'],
60
+ });
61
+ }
62
+ const configPath = findConfig(flags.config, env);
63
+ if (flags.config && !configPath) {
64
+ throw new CommandError(`Config file not found: ${resolve(flags.config)}`);
65
+ }
66
+ let loaded;
67
+ try {
68
+ loaded = loadRunConfig(configPath);
69
+ }
70
+ catch (error) {
71
+ throw new CommandError(`Failed to load config: ${error instanceof Error ? error.message : String(error)}`);
72
+ }
73
+ const llm = loaded.config.llm ?? {};
74
+ const defaultModel = env.COGITATOR_MODEL || llm.defaultModel || loaded.model;
75
+ const runs = integer(flags.runs, '--runs', 1, 50);
76
+ const concurrency = integer(flags.concurrency, '--concurrency', 1, 8);
77
+ const threshold = decimal(flags.threshold, '--threshold', 0, 1);
78
+ const maxCostUsd = decimal(flags.maxCostUsd, '--max-cost-usd', 0, Infinity);
79
+ const ablation = ablationOf(flags.ablation);
80
+ return {
81
+ ...(target !== undefined && { target }),
82
+ llm: { ...llm, ...(defaultModel && { defaultModel }) },
83
+ ...(flags.model !== undefined && { model: flags.model }),
84
+ ...(flags.judgeModel !== undefined && { judgeModel: flags.judgeModel }),
85
+ ...(runs !== undefined && { runs }),
86
+ ...(concurrency !== undefined && { concurrency }),
87
+ ...(ablation !== undefined && { ablation }),
88
+ ...(threshold !== undefined && { threshold }),
89
+ ...(maxCostUsd !== undefined && { maxCostUsd }),
90
+ ...(flags.allowTools !== undefined && { allowTools: flags.allowTools }),
91
+ ...(flags.scaffold && { scaffold: true }),
92
+ ...(flags.case !== undefined && { caseGlob: flags.case }),
93
+ ...(flags.tag !== undefined && { tags: flags.tag }),
94
+ ...(flags.evalDir !== undefined && { evalDir: flags.evalDir }),
95
+ ...(flags.outputDir !== undefined && { outputDir: flags.outputDir }),
96
+ ...(flags.keepTemp && { keepTemp: true }),
97
+ };
98
+ }
99
+ function score(value) {
100
+ return value === null || value === undefined ? '-' : value.toFixed(2);
101
+ }
102
+ function delta(value) {
103
+ if (value === undefined)
104
+ return '-';
105
+ return `${value > 0 ? '+' : ''}${value.toFixed(2)}`;
106
+ }
107
+ function usd(value) {
108
+ return `$${value.toFixed(2)}`;
109
+ }
110
+ function cut(text, max) {
111
+ const line = text.replace(/\s+/g, ' ').trim();
112
+ return line.length <= max ? line : `${line.slice(0, max - 3)}...`;
113
+ }
114
+ /** The highest-weight failing grader's explanation, or the run's error, from the with-arm */
115
+ export function caseNote(result) {
116
+ if (result.error !== undefined)
117
+ return result.error;
118
+ const failing = result.arms.with
119
+ .flatMap((run) => run.graders.filter((grader) => grader.scored && !grader.passed))
120
+ .sort((a, b) => b.weight - a.weight)[0];
121
+ if (failing)
122
+ return `${failing.name}: ${failing.explanation}`;
123
+ const errored = result.arms.with.find((run) => run.error !== null || run.aborted);
124
+ if (errored?.aborted)
125
+ return `aborted by ${errored.aborted.server}/${errored.aborted.tool}: ${errored.aborted.reason}`;
126
+ return errored?.error ?? '';
127
+ }
128
+ function table(rows) {
129
+ const widths = rows[0]?.map((_, column) => Math.max(...rows.map((row) => row[column]?.length ?? 0))) ?? [];
130
+ return rows.map((row) => row
131
+ .map((cell, column) => (column === row.length - 1 ? cell : cell.padEnd(widths[column] ?? 0)))
132
+ .join(' ')
133
+ .trimEnd());
134
+ }
135
+ /** The summary table: `CASE WITH W/OUT Δ RUNS COST NOTES`, or `SCORE PASS%` when no case has a baseline */
136
+ export function summaryLines(result) {
137
+ const twoArm = result.cases.some((c) => !c.singleArm);
138
+ const header = twoArm
139
+ ? ['CASE', 'WITH', 'W/OUT', 'Δ', 'RUNS', 'COST', 'NOTES']
140
+ : ['CASE', 'SCORE', 'PASS%', 'RUNS', 'COST', 'NOTES'];
141
+ const rows = result.cases.map((c) => {
142
+ const note = cut(caseNote(c), 70);
143
+ const tail = [String(c.aggregates.runs), usd(c.aggregates.costUsd), note];
144
+ if (twoArm) {
145
+ return [
146
+ c.name,
147
+ score(c.aggregates.score),
148
+ score(c.aggregates.withoutScore),
149
+ delta(c.aggregates.delta),
150
+ ...tail,
151
+ ];
152
+ }
153
+ const runs = c.arms.with;
154
+ const passing = runs.filter((run) => run.score >= result.config.threshold - 1e-9).length;
155
+ const share = runs.length === 0 ? '-' : `${Math.round((passing / runs.length) * 100)}%`;
156
+ return [c.name, score(c.aggregates.score), share, ...tail];
157
+ });
158
+ const totals = [
159
+ `${result.cases.length} case(s)`,
160
+ ...(result.aggregates.meanDelta !== undefined
161
+ ? [`mean Δ ${delta(result.aggregates.meanDelta)}`]
162
+ : []),
163
+ `${Math.round(result.durationSeconds)}s`,
164
+ usd(result.costUsd),
165
+ ].join(' · ');
166
+ return [...table([header, ...rows]), '', totals];
167
+ }
168
+ function runLine(caseName, run, of, verbose) {
169
+ const arm = run.arm === 'with' ? 'with' : 'w/out';
170
+ const verdicts = run.graders
171
+ .map((grader) => {
172
+ const mark = grader.skipped
173
+ ? chalk.dim('-')
174
+ : grader.passed
175
+ ? chalk.green('✓')
176
+ : chalk.red('✗');
177
+ return `${mark}${grader.scored ? grader.name : chalk.dim(grader.name)}`;
178
+ })
179
+ .join(' ');
180
+ const problem = run.aborted
181
+ ? chalk.red(` aborted: ${run.aborted.reason}`)
182
+ : run.error !== null
183
+ ? chalk.red(` error: ${run.error}`)
184
+ : '';
185
+ const lines = [
186
+ ` ${caseName} ${arm} ${run.index}/${of} ${run.score.toFixed(2)} ${usd(run.costUsd)} ${run.durationSeconds.toFixed(1)}s ${verdicts}${problem}`,
187
+ ];
188
+ if (run.tempDir)
189
+ lines.push(chalk.dim(` kept: ${run.tempDir}`));
190
+ if (verbose) {
191
+ for (const grader of run.graders)
192
+ lines.push(chalk.dim(` ${grader.name}: ${grader.explanation}`));
193
+ }
194
+ return lines;
195
+ }
196
+ function progress(verbose) {
197
+ let skipped = false;
198
+ return (event) => {
199
+ switch (event.type) {
200
+ case 'warning':
201
+ console.error(chalk.yellow(event.message));
202
+ return;
203
+ case 'case':
204
+ console.log(chalk.bold(`${event.case}`) + chalk.dim(` ${event.arms.join(' + ')}`));
205
+ for (const notice of event.notices)
206
+ console.log(chalk.dim(` ${notice}`));
207
+ return;
208
+ case 'run':
209
+ for (const line of runLine(event.case, event.run, event.of, verbose))
210
+ console.log(line);
211
+ return;
212
+ case 'skipped':
213
+ if (!skipped) {
214
+ skipped = true;
215
+ const why = event.reason === 'cost_ceiling'
216
+ ? 'the --max-cost-usd ceiling was reached'
217
+ : event.reason === 'auth_failed'
218
+ ? 'the model provider rejected the credentials'
219
+ : 'the run was interrupted';
220
+ console.log(chalk.yellow(`Remaining runs not started: ${why}`));
221
+ }
222
+ return;
223
+ }
224
+ };
225
+ }
226
+ function exitCodeOf(result) {
227
+ return PLUGIN_EVAL_EXIT[result.outcome];
228
+ }
229
+ /** Why the command fails although every case met the threshold, for stderr */
230
+ function hiddenCauses(result) {
231
+ const causes = [];
232
+ if (result.loadErrors > 0)
233
+ causes.push(`${result.loadErrors} case(s) failed to load`);
234
+ if (result.apiErrors > 0) {
235
+ causes.push(`${result.apiErrors} run(s) ended on an API error and scored 0 without grading`);
236
+ }
237
+ return causes;
238
+ }
239
+ /** Runs a plugin's eval suite and resolves with the exit code */
240
+ export async function runPluginEval(target, flags, dependencies = DEFAULT_DEPENDENCIES) {
241
+ const quiet = flags.json !== undefined && flags.json !== false;
242
+ const options = pluginEvalOptions(target, flags, dependencies.env);
243
+ const controller = new AbortController();
244
+ let terminated = false;
245
+ const interrupt = () => controller.abort();
246
+ const terminate = () => {
247
+ terminated = true;
248
+ controller.abort();
249
+ };
250
+ process.once('SIGINT', interrupt);
251
+ process.once('SIGTERM', terminate);
252
+ let report;
253
+ try {
254
+ report = await dependencies.run({
255
+ ...options,
256
+ signal: controller.signal,
257
+ ...(!quiet && { onProgress: progress(flags.verbose === true) }),
258
+ });
259
+ }
260
+ catch (error) {
261
+ if (error instanceof PluginEvalError)
262
+ throw new CommandError(error.message, { cause: error });
263
+ throw error;
264
+ }
265
+ finally {
266
+ process.removeListener('SIGINT', interrupt);
267
+ process.removeListener('SIGTERM', terminate);
268
+ }
269
+ const { result } = report;
270
+ for (const cause of hiddenCauses(result))
271
+ console.error(chalk.red(cause));
272
+ if (result.partial) {
273
+ console.error(chalk.yellow(`Partial results (${result.partialReason ?? 'unknown'})`));
274
+ }
275
+ if (typeof flags.json === 'string') {
276
+ writeFileSync(resolve(flags.json), `${JSON.stringify(result, null, 2)}\n`);
277
+ }
278
+ else if (flags.json === true) {
279
+ console.log(JSON.stringify(result, null, 2));
280
+ }
281
+ else {
282
+ console.log('');
283
+ for (const line of summaryLines(result))
284
+ console.log(line);
285
+ console.log(`Report: ${report.reportFile}`);
286
+ }
287
+ return terminated ? PLUGIN_EVAL_EXIT.terminated : exitCodeOf(result);
288
+ }
289
+ /**
290
+ * A command whose command-line errors (an unknown option, a missing or wrong value) exit 1 as
291
+ * `CommandError`s: exit 2 means a partial run for `claude plugin eval`, so it is never a usage error
292
+ * here. Commander's own message is not printed, the entry point reports the error once
293
+ */
294
+ class PluginEvalCommand extends Command {
295
+ exitOverride(callback) {
296
+ return super.exitOverride((error) => {
297
+ if (error.exitCode === 0) {
298
+ if (callback)
299
+ return callback(error);
300
+ throw error;
301
+ }
302
+ throw new CommandError(error.message.replace(/^error: /, ''), { cause: error });
303
+ });
304
+ }
305
+ }
306
+ /** `eval`: runs the eval cases of a plugin, mounted under `cogitator plugin` */
307
+ export const pluginEvalCommand = new PluginEvalCommand('eval')
308
+ .description("Run a plugin's eval cases (Claude Code's plugin eval format) with and without the plugin, and score them")
309
+ .argument('[target]', 'a plugin directory, a prompt.md or case.yaml file, or an installed plugin as name or name@marketplace (default: .)')
310
+ .option('--runs <n>', "runs per case in each arm, 1 to 50 (default: each case's runs, else 3)")
311
+ .option('-j, --concurrency <n>', 'agent runs at once, 1 to 8 (default: 1)')
312
+ .option('--model <model>', "model of the agent under test (default: each case's model, else the configured one)")
313
+ .option('--judge-model <model>', 'model of llm and baseline graders (default: the agent model)')
314
+ .option('--ablation <mode>', 'none runs the plugin arm only, with-without adds the no-plugin baseline')
315
+ .option('--threshold <0..1>', 'a case passes when its with-plugin score is at least this (default: 1.0)')
316
+ .option('--max-cost-usd <usd>', 'stop starting runs once the cost estimate reaches this, exit 2')
317
+ .option('--allow-tools <tools...>', 'grant tools beyond the read-only set: Write, Edit, "Bash(npm test *)"')
318
+ .option('--scaffold', "run each case's context.scaffold_script")
319
+ .option('--case <glob>', 'only the cases whose name matches the glob')
320
+ .option('--tag <tags...>', 'only the cases with any of these tags')
321
+ .option('--eval-dir <dir>', "the plugin's eval directory (default: plugin.json experimental.evals, else evals)")
322
+ .option('--json [path]', 'print the result document, or write it to a .json path, without progress')
323
+ .option('--output-dir <dir>', 'where aggregate-result.json and report.html go (default: <eval dir>/results/<timestamp>)')
324
+ .option('--keep-temp', "keep every run's temporary directory and print its path")
325
+ .option('--verbose', "print every grader's explanation")
326
+ .option('-c, --config <path>', 'config file with the LLM providers (default: cogitator.yml)')
327
+ .option('--trust-plugin', 'accepted for Claude Code command lines, there is no trust prompt')
328
+ .option('--no-publish', 'accepted for Claude Code command lines, the report always stays local')
329
+ .option('--publish-report', 'accepted for Claude Code command lines, the report always stays local')
330
+ .option('--mocks <mode>', 'record (the only mode): mocked MCP tools answer from their files', 'record')
331
+ .option('--allow-real-servers', 'not supported: real plugin MCP servers are not started, the command exits 1')
332
+ .configureOutput({ outputError: () => undefined })
333
+ .addHelpText('after', examplesHelp([
334
+ ['cogitator plugin eval .', 'every case of the plugin here, with and without it'],
335
+ ['cogitator plugin eval . --case greets --runs 1 --ablation none', 'iterate on one case'],
336
+ ['cogitator plugin eval . --json results.json --threshold 0.8 --max-cost-usd 20', 'for CI'],
337
+ ]))
338
+ .action(async (target, flags) => {
339
+ let code;
340
+ try {
341
+ code = await runPluginEval(target, flags);
342
+ }
343
+ catch (error) {
344
+ code = reportFailure(error, { json: flags.json !== undefined && flags.json !== false });
345
+ }
346
+ process.exit(code);
347
+ });
348
+ //# sourceMappingURL=plugin-eval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-eval.js","sourceRoot":"","sources":["../../src/commands/plugin-eval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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KAC5F,MAAM,CAAC,cAAc,EAAE,uEAAuE,CAAC;KAC/F,MAAM,CACL,kBAAkB,EAClB,uEAAuE,CACxE;KACA,MAAM,CACL,gBAAgB,EAChB,kEAAkE,EAClE,QAAQ,CACT;KACA,MAAM,CACL,sBAAsB,EACtB,6EAA6E,CAC9E;KACA,eAAe,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC;KACjD,WAAW,CACV,OAAO,EACP,YAAY,CAAC;IACX,CAAC,yBAAyB,EAAE,oDAAoD,CAAC;IACjF,CAAC,gEAAgE,EAAE,qBAAqB,CAAC;IACzF,CAAC,+EAA+E,EAAE,QAAQ,CAAC;CAC5F,CAAC,CACH;KACA,MAAM,CAAC,KAAK,EAAE,MAA0B,EAAE,KAAsB,EAAE,EAAE;IACnE,IAAI,IAAY,CAAC;IACjB,IAAI,CAAC;QACH,IAAI,GAAG,MAAM,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,GAAG,aAAa,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC;IAC1F,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * cogitator plugin - install, update and manage plugins and their marketplaces, in the formats of
3
+ * Claude Code's plugins, and run their eval suites
4
+ */
5
+ import { Command } from 'commander';
6
+ import { experimental_PluginInstaller, type PluginInstallerOptions } from '@cogitator-ai/core';
7
+ import type { PluginOptionValue } from '@cogitator-ai/types';
8
+ /** How the plugin commands talk to the person running them */
9
+ export interface PluginIo {
10
+ print(line: string): void;
11
+ /** Asks a yes or no question, undefined when nobody can answer (not a terminal) */
12
+ confirm(question: string): Promise<boolean | undefined>;
13
+ /** Reads a secret without showing it, undefined when nobody can answer */
14
+ secret(question: string): Promise<string | undefined>;
15
+ }
16
+ /** What the commands are built with: the installer's options and how to talk */
17
+ export interface PluginCommandContext {
18
+ io: PluginIo;
19
+ installer: (options: PluginInstallerOptions) => experimental_PluginInstaller;
20
+ cwd: string;
21
+ /** Directories of the user's settings (default `~/.cogitator`, `~/.claude`) */
22
+ userDirs?: readonly string[];
23
+ }
24
+ /** Talks on the terminal: prompts only when stdin is one */
25
+ export declare function terminalPluginIo(): PluginIo;
26
+ type Scope = 'user' | 'project' | 'local';
27
+ /** `key=value` pairs as option values: `true`, `false` and numbers read as such */
28
+ export declare function parseOptionPairs(pairs: readonly string[]): Record<string, PluginOptionValue>;
29
+ interface CommonFlags {
30
+ json?: boolean;
31
+ yes?: boolean;
32
+ }
33
+ /** `cogitator plugin install` */
34
+ export declare function runInstall(spec: string, flags: CommonFlags & {
35
+ scope?: Scope;
36
+ config?: string[];
37
+ secret?: string[];
38
+ marketplace?: string;
39
+ }, context?: PluginCommandContext): Promise<number>;
40
+ /** `cogitator plugin uninstall` */
41
+ export declare function runUninstall(spec: string, flags: CommonFlags & {
42
+ keepData?: boolean;
43
+ prune?: boolean;
44
+ }, context?: PluginCommandContext): Promise<number>;
45
+ /** `cogitator plugin enable` and `disable` */
46
+ export declare function runSetEnabled(spec: string, enabled: boolean, flags: CommonFlags & {
47
+ scope?: Scope;
48
+ }, context?: PluginCommandContext): Promise<number>;
49
+ /** `cogitator plugin update` */
50
+ export declare function runUpdate(spec: string | undefined, flags: CommonFlags, context?: PluginCommandContext): Promise<number>;
51
+ /** `cogitator plugin list`: the install records, what the settings enable, what is wrong with each */
52
+ export declare function runList(flags: CommonFlags & {
53
+ available?: boolean;
54
+ }, context?: PluginCommandContext): Promise<number>;
55
+ /** `cogitator plugin configure` */
56
+ export declare function runConfigure(spec: string, flags: CommonFlags & {
57
+ set?: string[];
58
+ secret?: string[];
59
+ unset?: string[];
60
+ }, context?: PluginCommandContext): Promise<number>;
61
+ /** `cogitator plugin validate`: 0 passed, 1 failed, 2 when the validator itself failed */
62
+ export declare function runValidate(path: string, flags: {
63
+ strict?: boolean;
64
+ json?: boolean;
65
+ }, context?: PluginCommandContext): Promise<number>;
66
+ /** `cogitator plugin marketplace add|list|remove|update` */
67
+ export declare function runMarketplace(action: 'add' | 'list' | 'remove' | 'update', argument: string | undefined, flags: CommonFlags, context?: PluginCommandContext): Promise<number>;
68
+ export declare const pluginCommand: Command;
69
+ export {};
70
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/commands/plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAwB,MAAM,WAAW,CAAC;AAK1D,OAAO,EACL,4BAA4B,EAK5B,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAI7D,8DAA8D;AAC9D,MAAM,WAAW,QAAQ;IACvB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,mFAAmF;IACnF,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IACxD,0EAA0E;IAC1E,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CACvD;AAED,gFAAgF;AAChF,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,QAAQ,CAAC;IACb,SAAS,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,4BAA4B,CAAC;IAC7E,GAAG,EAAE,MAAM,CAAC;IACZ,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B;AAED,4DAA4D;AAC5D,wBAAgB,gBAAgB,IAAI,QAAQ,CAmB3C;A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