claudecode-omc 4.8.0 → 4.8.2
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/.claude-plugin/plugin.json +1 -1
- package/bridge/cli.cjs +316 -7669
- package/dist/cli/index.js +0 -20
- package/dist/cli/index.js.map +1 -1
- package/dist/hud/usage-api.d.ts +1 -0
- package/dist/hud/usage-api.d.ts.map +1 -1
- package/dist/hud/usage-api.js +29 -0
- package/dist/hud/usage-api.js.map +1 -1
- package/dist/testing/cli/commands.d.ts +0 -11
- package/dist/testing/cli/commands.d.ts.map +1 -1
- package/dist/testing/cli/commands.js +0 -22
- package/dist/testing/cli/commands.js.map +1 -1
- package/docs/testing/IMPLEMENTATION.md +804 -0
- package/package.json +1 -1
- package/dist/testing/integrations/promptfoo/config-generator.d.ts +0 -5
- package/dist/testing/integrations/promptfoo/config-generator.d.ts.map +0 -1
- package/dist/testing/integrations/promptfoo/config-generator.js +0 -44
- package/dist/testing/integrations/promptfoo/config-generator.js.map +0 -1
- package/dist/testing/integrations/promptfoo/types.d.ts +0 -36
- package/dist/testing/integrations/promptfoo/types.d.ts.map +0 -1
- package/dist/testing/integrations/promptfoo/types.js +0 -2
- package/dist/testing/integrations/promptfoo/types.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { PromptfooConfig, PromptfooTestCase, GenerateConfigOptions, GenerateTestCasesOptions } from './types.js';
|
|
2
|
-
export declare function generatePromptfooConfig(options: GenerateConfigOptions): Promise<PromptfooConfig>;
|
|
3
|
-
export declare function generateTestCases(options: GenerateTestCasesOptions): Promise<PromptfooTestCase[]>;
|
|
4
|
-
export declare function savePromptfooConfig(config: PromptfooConfig, outputPath: string): Promise<void>;
|
|
5
|
-
//# sourceMappingURL=config-generator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-generator.d.ts","sourceRoot":"","sources":["../../../../src/testing/integrations/promptfoo/config-generator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAEpB,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CAwBtG;AAED,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAevG;AAED,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGpG"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { writeFile } from 'fs/promises';
|
|
2
|
-
import * as yaml from 'yaml';
|
|
3
|
-
export async function generatePromptfooConfig(options) {
|
|
4
|
-
const { promptFile, testCases, provider, outputPath } = options;
|
|
5
|
-
const tests = testCases.map((tc) => {
|
|
6
|
-
const [assertType, assertValue] = tc.expected.split(':');
|
|
7
|
-
return {
|
|
8
|
-
vars: { input: tc.input },
|
|
9
|
-
assert: [
|
|
10
|
-
{
|
|
11
|
-
type: assertType,
|
|
12
|
-
value: assertValue,
|
|
13
|
-
},
|
|
14
|
-
],
|
|
15
|
-
};
|
|
16
|
-
});
|
|
17
|
-
const config = {
|
|
18
|
-
prompts: [`file://${promptFile}`],
|
|
19
|
-
providers: [provider],
|
|
20
|
-
tests,
|
|
21
|
-
outputPath: outputPath || './promptfoo-results.json',
|
|
22
|
-
};
|
|
23
|
-
return config;
|
|
24
|
-
}
|
|
25
|
-
export async function generateTestCases(options) {
|
|
26
|
-
const { codeExamples, assertionType } = options;
|
|
27
|
-
return codeExamples.map((example) => ({
|
|
28
|
-
vars: {
|
|
29
|
-
code: example.code,
|
|
30
|
-
language: example.language,
|
|
31
|
-
},
|
|
32
|
-
assert: [
|
|
33
|
-
{
|
|
34
|
-
type: assertionType,
|
|
35
|
-
value: example.language === 'javascript' ? 'function' : 'def',
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
export async function savePromptfooConfig(config, outputPath) {
|
|
41
|
-
const yamlContent = yaml.stringify(config);
|
|
42
|
-
await writeFile(outputPath, yamlContent, 'utf-8');
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=config-generator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-generator.js","sourceRoot":"","sources":["../../../../src/testing/integrations/promptfoo/config-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAQ7B,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,OAA8B;IAC1E,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAEhE,MAAM,KAAK,GAAwB,SAAS,CAAC,GAAG,CAAC,CAAC,EAAuC,EAAE,EAAE;QAC3F,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACzD,OAAO;YACL,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE;YACzB,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,UAAiB;oBACvB,KAAK,EAAE,WAAW;iBACnB;aACF;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,MAAM,GAAoB;QAC9B,OAAO,EAAE,CAAC,UAAU,UAAU,EAAE,CAAC;QACjC,SAAS,EAAE,CAAC,QAAQ,CAAC;QACrB,KAAK;QACL,UAAU,EAAE,UAAU,IAAI,0BAA0B;KACrD,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAAiC;IACvE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAEhD,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,OAA2C,EAAE,EAAE,CAAC,CAAC;QACxE,IAAI,EAAE;YACJ,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B;QACD,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,aAAa;gBACnB,KAAK,EAAE,OAAO,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK;aAC9D;SACF;KACF,CAAC,CAAC,CAAC;AACN,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,MAAuB,EAAE,UAAkB;IACnF,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,SAAS,CAAC,UAAU,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export interface PromptfooConfig {
|
|
2
|
-
prompts: string[];
|
|
3
|
-
providers: string[];
|
|
4
|
-
tests: PromptfooTestCase[];
|
|
5
|
-
defaultTest?: {
|
|
6
|
-
assert?: PromptfooAssertion[];
|
|
7
|
-
};
|
|
8
|
-
outputPath?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface PromptfooTestCase {
|
|
11
|
-
vars?: Record<string, any>;
|
|
12
|
-
assert?: PromptfooAssertion[];
|
|
13
|
-
description?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface PromptfooAssertion {
|
|
16
|
-
type: 'equals' | 'contains' | 'not-contains' | 'regex' | 'javascript' | 'llm-rubric';
|
|
17
|
-
value?: string;
|
|
18
|
-
threshold?: number;
|
|
19
|
-
}
|
|
20
|
-
export interface GenerateConfigOptions {
|
|
21
|
-
promptFile: string;
|
|
22
|
-
testCases: Array<{
|
|
23
|
-
input: string;
|
|
24
|
-
expected: string;
|
|
25
|
-
}>;
|
|
26
|
-
provider: string;
|
|
27
|
-
outputPath?: string;
|
|
28
|
-
}
|
|
29
|
-
export interface GenerateTestCasesOptions {
|
|
30
|
-
codeExamples: Array<{
|
|
31
|
-
code: string;
|
|
32
|
-
language: string;
|
|
33
|
-
}>;
|
|
34
|
-
assertionType: 'contains' | 'equals' | 'regex';
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/testing/integrations/promptfoo/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE;QACZ,MAAM,CAAC,EAAE,kBAAkB,EAAE,CAAC;KAC/B,CAAC;IACF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,MAAM,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,QAAQ,GAAG,UAAU,GAAG,cAAc,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,CAAC;IACrF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxD,aAAa,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;CAChD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/testing/integrations/promptfoo/types.ts"],"names":[],"mappings":""}
|