@ai-agent-forge/plugin-test-runner 0.85.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.
Files changed (52) hide show
  1. package/README.md +44 -0
  2. package/agent-forge.json +12 -0
  3. package/dist/capability.d.ts +5 -0
  4. package/dist/capability.d.ts.map +1 -0
  5. package/dist/capability.js +138 -0
  6. package/dist/capability.js.map +1 -0
  7. package/dist/entry.d.ts +13 -0
  8. package/dist/entry.d.ts.map +1 -0
  9. package/dist/entry.js +14 -0
  10. package/dist/entry.js.map +1 -0
  11. package/dist/index.d.ts +12 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +10 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/node-adapter.d.ts +24 -0
  16. package/dist/node-adapter.d.ts.map +1 -0
  17. package/dist/node-adapter.js +448 -0
  18. package/dist/node-adapter.js.map +1 -0
  19. package/dist/node-jest-json-report.d.ts +12 -0
  20. package/dist/node-jest-json-report.d.ts.map +1 -0
  21. package/dist/node-jest-json-report.js +52 -0
  22. package/dist/node-jest-json-report.js.map +1 -0
  23. package/dist/node-jest-runner.d.ts +26 -0
  24. package/dist/node-jest-runner.d.ts.map +1 -0
  25. package/dist/node-jest-runner.js +51 -0
  26. package/dist/node-jest-runner.js.map +1 -0
  27. package/dist/node-junit-xml-report.d.ts +11 -0
  28. package/dist/node-junit-xml-report.d.ts.map +1 -0
  29. package/dist/node-junit-xml-report.js +76 -0
  30. package/dist/node-junit-xml-report.js.map +1 -0
  31. package/dist/node-pytest-runner.d.ts +34 -0
  32. package/dist/node-pytest-runner.d.ts.map +1 -0
  33. package/dist/node-pytest-runner.js +111 -0
  34. package/dist/node-pytest-runner.js.map +1 -0
  35. package/dist/node-test-process.d.ts +24 -0
  36. package/dist/node-test-process.d.ts.map +1 -0
  37. package/dist/node-test-process.js +89 -0
  38. package/dist/node-test-process.js.map +1 -0
  39. package/dist/node-vitest-runner.d.ts +24 -0
  40. package/dist/node-vitest-runner.d.ts.map +1 -0
  41. package/dist/node-vitest-runner.js +49 -0
  42. package/dist/node-vitest-runner.js.map +1 -0
  43. package/dist/shell-utils.d.ts +15 -0
  44. package/dist/shell-utils.d.ts.map +1 -0
  45. package/dist/shell-utils.js +43 -0
  46. package/dist/shell-utils.js.map +1 -0
  47. package/dist/types.d.ts +93 -0
  48. package/dist/types.d.ts.map +1 -0
  49. package/dist/types.js +5 -0
  50. package/dist/types.js.map +1 -0
  51. package/package.json +55 -0
  52. package/plugin.json +9 -0
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Inlined from agent-forge `src/utils/shell.ts` (D-075 S3 extraction) so this
3
+ * package keeps its dependency closure limited to the plugin SDK and typebox.
4
+ * Semantics are unchanged.
5
+ */
6
+ /**
7
+ * Sanitize binary output for display/storage.
8
+ * Removes characters that crash string-width or cause display issues:
9
+ * - Control characters (except tab, newline, carriage return)
10
+ * - Lone surrogates
11
+ * - Unicode Format characters (crash string-width due to a bug)
12
+ * - Characters with undefined code points
13
+ */
14
+ export declare function sanitizeBinaryOutput(str: string): string;
15
+ //# sourceMappingURL=shell-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-utils.d.ts","sourceRoot":"","sources":["../src/shell-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CA8BxD","sourcesContent":["/**\n * Inlined from agent-forge `src/utils/shell.ts` (D-075 S3 extraction) so this\n * package keeps its dependency closure limited to the plugin SDK and typebox.\n * Semantics are unchanged.\n */\n\n/**\n * Sanitize binary output for display/storage.\n * Removes characters that crash string-width or cause display issues:\n * - Control characters (except tab, newline, carriage return)\n * - Lone surrogates\n * - Unicode Format characters (crash string-width due to a bug)\n * - Characters with undefined code points\n */\nexport function sanitizeBinaryOutput(str: string): string {\n\t// Use Array.from to properly iterate over code points (not code units)\n\t// This handles surrogate pairs correctly and catches edge cases where\n\t// codePointAt() might return undefined\n\treturn Array.from(str)\n\t\t.filter((char) => {\n\t\t\t// Filter out characters that cause string-width to crash\n\t\t\t// This includes:\n\t\t\t// - Unicode format characters\n\t\t\t// - Lone surrogates (already filtered by Array.from)\n\t\t\t// - Control chars except \\t \\n \\r\n\t\t\t// - Characters with undefined code points\n\n\t\t\tconst code = char.codePointAt(0);\n\n\t\t\t// v8 ignore next -- Array.from iterating over a legal string, codePointAt will not return undefined\n\t\t\tif (code === undefined) return false;\n\n\t\t\t// Allow tab, newline, carriage return\n\t\t\tif (code === 0x09 || code === 0x0a || code === 0x0d) return true;\n\n\t\t\t// Filter out control characters (0x00-0x1F, except 0x09, 0x0a, 0x0d)\n\t\t\tif (code <= 0x1f) return false;\n\n\t\t\t// Filter out Unicode format characters\n\t\t\tif (code >= 0xfff9 && code <= 0xfffb) return false;\n\n\t\t\treturn true;\n\t\t})\n\t\t.join(\"\");\n}\n"]}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Inlined from agent-forge `src/utils/shell.ts` (D-075 S3 extraction) so this
3
+ * package keeps its dependency closure limited to the plugin SDK and typebox.
4
+ * Semantics are unchanged.
5
+ */
6
+ /**
7
+ * Sanitize binary output for display/storage.
8
+ * Removes characters that crash string-width or cause display issues:
9
+ * - Control characters (except tab, newline, carriage return)
10
+ * - Lone surrogates
11
+ * - Unicode Format characters (crash string-width due to a bug)
12
+ * - Characters with undefined code points
13
+ */
14
+ export function sanitizeBinaryOutput(str) {
15
+ // Use Array.from to properly iterate over code points (not code units)
16
+ // This handles surrogate pairs correctly and catches edge cases where
17
+ // codePointAt() might return undefined
18
+ return Array.from(str)
19
+ .filter((char) => {
20
+ // Filter out characters that cause string-width to crash
21
+ // This includes:
22
+ // - Unicode format characters
23
+ // - Lone surrogates (already filtered by Array.from)
24
+ // - Control chars except \t \n \r
25
+ // - Characters with undefined code points
26
+ const code = char.codePointAt(0);
27
+ // v8 ignore next -- Array.from iterating over a legal string, codePointAt will not return undefined
28
+ if (code === undefined)
29
+ return false;
30
+ // Allow tab, newline, carriage return
31
+ if (code === 0x09 || code === 0x0a || code === 0x0d)
32
+ return true;
33
+ // Filter out control characters (0x00-0x1F, except 0x09, 0x0a, 0x0d)
34
+ if (code <= 0x1f)
35
+ return false;
36
+ // Filter out Unicode format characters
37
+ if (code >= 0xfff9 && code <= 0xfffb)
38
+ return false;
39
+ return true;
40
+ })
41
+ .join("");
42
+ }
43
+ //# sourceMappingURL=shell-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-utils.js","sourceRoot":"","sources":["../src/shell-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAW,EAAU;IACzD,uEAAuE;IACvE,sEAAsE;IACtE,uCAAuC;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;SACpB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QACjB,yDAAyD;QACzD,iBAAiB;QACjB,8BAA8B;QAC9B,qDAAqD;QACrD,kCAAkC;QAClC,0CAA0C;QAE1C,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAEjC,oGAAoG;QACpG,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QAErC,sCAAsC;QACtC,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QAEjE,qEAAqE;QACrE,IAAI,IAAI,IAAI,IAAI;YAAE,OAAO,KAAK,CAAC;QAE/B,uCAAuC;QACvC,IAAI,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM;YAAE,OAAO,KAAK,CAAC;QAEnD,OAAO,IAAI,CAAC;IAAA,CACZ,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,CAAC;AAAA,CACX","sourcesContent":["/**\n * Inlined from agent-forge `src/utils/shell.ts` (D-075 S3 extraction) so this\n * package keeps its dependency closure limited to the plugin SDK and typebox.\n * Semantics are unchanged.\n */\n\n/**\n * Sanitize binary output for display/storage.\n * Removes characters that crash string-width or cause display issues:\n * - Control characters (except tab, newline, carriage return)\n * - Lone surrogates\n * - Unicode Format characters (crash string-width due to a bug)\n * - Characters with undefined code points\n */\nexport function sanitizeBinaryOutput(str: string): string {\n\t// Use Array.from to properly iterate over code points (not code units)\n\t// This handles surrogate pairs correctly and catches edge cases where\n\t// codePointAt() might return undefined\n\treturn Array.from(str)\n\t\t.filter((char) => {\n\t\t\t// Filter out characters that cause string-width to crash\n\t\t\t// This includes:\n\t\t\t// - Unicode format characters\n\t\t\t// - Lone surrogates (already filtered by Array.from)\n\t\t\t// - Control chars except \\t \\n \\r\n\t\t\t// - Characters with undefined code points\n\n\t\t\tconst code = char.codePointAt(0);\n\n\t\t\t// v8 ignore next -- Array.from iterating over a legal string, codePointAt will not return undefined\n\t\t\tif (code === undefined) return false;\n\n\t\t\t// Allow tab, newline, carriage return\n\t\t\tif (code === 0x09 || code === 0x0a || code === 0x0d) return true;\n\n\t\t\t// Filter out control characters (0x00-0x1F, except 0x09, 0x0a, 0x0d)\n\t\t\tif (code <= 0x1f) return false;\n\n\t\t\t// Filter out Unicode format characters\n\t\t\tif (code >= 0xfff9 && code <= 0xfffb) return false;\n\n\t\t\treturn true;\n\t\t})\n\t\t.join(\"\");\n}\n"]}
@@ -0,0 +1,93 @@
1
+ import type { PluginErrorV1, PluginResultStatusV1 } from "@agent-forge/plugin-sdk";
2
+ export declare const TEST_RUNNER_PLUGIN_ID_V1: "agent-forge.plugin.test-runner";
3
+ export declare const TEST_RUNNER_CAPABILITY_VERSION_V1: 1;
4
+ export declare const TEST_RUNNER_HOST_ADAPTER_ID_V1: "node-test-runner";
5
+ export declare const TEST_RUNNER_HOST_ADAPTER_VERSION_V1: "1.0.0";
6
+ export type TestRunnerFrameworkV1 = "vitest" | "jest" | "node-test" | "pytest";
7
+ export interface TestRunRequestV1 {
8
+ readonly version: 1;
9
+ readonly operationId: string;
10
+ /** Opaque host-owned workspace handle, never a local path. */
11
+ readonly workspaceRef: string;
12
+ readonly framework: TestRunnerFrameworkV1;
13
+ /** A framework-specific selector. The host converts this to fixed argv. */
14
+ readonly target: string;
15
+ readonly timeoutMs?: number;
16
+ readonly maxFailures?: number;
17
+ }
18
+ export interface TestRunSummaryV1 {
19
+ readonly total: number;
20
+ readonly passed: number;
21
+ readonly failed: number;
22
+ readonly skipped: number;
23
+ readonly flaky: number;
24
+ }
25
+ /** A relative test identifier, not an absolute host path or a raw stack trace. */
26
+ export interface TestRunFailureV1 {
27
+ readonly file: string;
28
+ readonly line?: number;
29
+ readonly column?: number;
30
+ readonly message: string;
31
+ }
32
+ /**
33
+ * Structured model-facing test result. Full framework stdout/stderr stays in
34
+ * host-owned reports and is never part of this DTO.
35
+ */
36
+ export interface TestRunResultV1 {
37
+ readonly version: 1;
38
+ readonly operationId: string;
39
+ readonly status: PluginResultStatusV1;
40
+ readonly summary: TestRunSummaryV1;
41
+ readonly failures: readonly TestRunFailureV1[];
42
+ readonly failuresTruncated: boolean;
43
+ readonly exitCode?: number;
44
+ readonly reportArtifactRef?: string;
45
+ readonly error?: PluginErrorV1;
46
+ }
47
+ /** A command identity and argv resolved exclusively by the host. */
48
+ export interface TestRunnerCommandV1 {
49
+ readonly commandId: string;
50
+ readonly args: readonly string[];
51
+ }
52
+ export interface TestRunnerCommandResolverV1 {
53
+ resolve(request: TestRunRequestV1, signal?: AbortSignal): Promise<TestRunnerCommandV1 | undefined>;
54
+ }
55
+ /** The runner owns executable path, cwd, environment, parsing, and raw logs. */
56
+ export interface TestRunnerCommandRunnerV1 {
57
+ run(input: {
58
+ readonly command: TestRunnerCommandV1;
59
+ readonly timeoutMs: number;
60
+ readonly signal: AbortSignal;
61
+ }): Promise<TestRunnerCommandResultV1>;
62
+ }
63
+ /** Host-private parsed result. It intentionally has no stdout/stderr fields. */
64
+ export type TestRunnerCommandResultV1 = {
65
+ readonly status: "completed";
66
+ readonly exitCode: number;
67
+ readonly summary: TestRunSummaryV1;
68
+ readonly failures?: readonly TestRunFailureV1[];
69
+ readonly reportArtifactRef?: string;
70
+ } | {
71
+ readonly status: "unsupported";
72
+ };
73
+ export interface TestRunnerAdapterV1 {
74
+ readonly adapterId: string;
75
+ readonly adapterVersion: string;
76
+ run(request: TestRunRequestV1, signal?: AbortSignal): Promise<TestRunResultV1>;
77
+ }
78
+ export interface TestRunnerDeterministicFixtureV1 {
79
+ readonly workspaceRef: string;
80
+ readonly framework: TestRunnerFrameworkV1;
81
+ readonly target: string;
82
+ readonly result: TestRunnerCommandResultV1;
83
+ }
84
+ export interface TestRunnerPluginManifestV1 {
85
+ readonly id: typeof TEST_RUNNER_PLUGIN_ID_V1;
86
+ readonly pluginVersion: string;
87
+ readonly apiVersion: "1";
88
+ readonly capabilityRefs: readonly {
89
+ readonly id: "test.run";
90
+ readonly version: 1;
91
+ }[];
92
+ }
93
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEnF,eAAO,MAAM,wBAAwB,kCAA4C,CAAC;AAClF,eAAO,MAAM,iCAAiC,GAAa,CAAC;AAC5D,eAAO,MAAM,8BAA8B,oBAA8B,CAAC;AAC1E,eAAO,MAAM,mCAAmC,SAAmB,CAAC;AAEpE,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE/E,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,8DAA8D;IAC9D,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAA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C;IACxB,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;CAC3C;AAED,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,EAAE,EAAE,OAAO,wBAAwB,CAAC;IAC7C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC;IACzB,QAAQ,CAAC,cAAc,EAAE,SAAS;QAAE,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAA;KAAE,EAAE,CAAC;CACrF","sourcesContent":["import type { PluginErrorV1, PluginResultStatusV1 } from \"@agent-forge/plugin-sdk\";\n\nexport const TEST_RUNNER_PLUGIN_ID_V1 = \"agent-forge.plugin.test-runner\" as const;\nexport const TEST_RUNNER_CAPABILITY_VERSION_V1 = 1 as const;\nexport const TEST_RUNNER_HOST_ADAPTER_ID_V1 = \"node-test-runner\" as const;\nexport const TEST_RUNNER_HOST_ADAPTER_VERSION_V1 = \"1.0.0\" as const;\n\nexport type TestRunnerFrameworkV1 = \"vitest\" | \"jest\" | \"node-test\" | \"pytest\";\n\nexport interface TestRunRequestV1 {\n\treadonly version: 1;\n\treadonly operationId: string;\n\t/** Opaque host-owned workspace handle, never a local path. */\n\treadonly workspaceRef: string;\n\treadonly framework: TestRunnerFrameworkV1;\n\t/** A framework-specific selector. The host converts this to fixed argv. */\n\treadonly target: string;\n\treadonly timeoutMs?: number;\n\treadonly maxFailures?: number;\n}\n\nexport interface TestRunSummaryV1 {\n\treadonly total: number;\n\treadonly passed: number;\n\treadonly failed: number;\n\treadonly skipped: number;\n\treadonly flaky: number;\n}\n\n/** A relative test identifier, not an absolute host path or a raw stack trace. */\nexport interface TestRunFailureV1 {\n\treadonly file: string;\n\treadonly line?: number;\n\treadonly column?: number;\n\treadonly message: string;\n}\n\n/**\n * Structured model-facing test result. Full framework stdout/stderr stays in\n * host-owned reports and is never part of this DTO.\n */\nexport interface TestRunResultV1 {\n\treadonly version: 1;\n\treadonly operationId: string;\n\treadonly status: PluginResultStatusV1;\n\treadonly summary: TestRunSummaryV1;\n\treadonly failures: readonly TestRunFailureV1[];\n\treadonly failuresTruncated: boolean;\n\treadonly exitCode?: number;\n\treadonly reportArtifactRef?: string;\n\treadonly error?: PluginErrorV1;\n}\n\n/** A command identity and argv resolved exclusively by the host. */\nexport interface TestRunnerCommandV1 {\n\treadonly commandId: string;\n\treadonly args: readonly string[];\n}\n\nexport interface TestRunnerCommandResolverV1 {\n\tresolve(request: TestRunRequestV1, signal?: AbortSignal): Promise<TestRunnerCommandV1 | undefined>;\n}\n\n/** The runner owns executable path, cwd, environment, parsing, and raw logs. */\nexport interface TestRunnerCommandRunnerV1 {\n\trun(input: {\n\t\treadonly command: TestRunnerCommandV1;\n\t\treadonly timeoutMs: number;\n\t\treadonly signal: AbortSignal;\n\t}): Promise<TestRunnerCommandResultV1>;\n}\n\n/** Host-private parsed result. It intentionally has no stdout/stderr fields. */\nexport type TestRunnerCommandResultV1 =\n\t| {\n\t\t\treadonly status: \"completed\";\n\t\t\treadonly exitCode: number;\n\t\t\treadonly summary: TestRunSummaryV1;\n\t\t\treadonly failures?: readonly TestRunFailureV1[];\n\t\t\treadonly reportArtifactRef?: string;\n\t }\n\t| { readonly status: \"unsupported\" };\n\nexport interface TestRunnerAdapterV1 {\n\treadonly adapterId: string;\n\treadonly adapterVersion: string;\n\trun(request: TestRunRequestV1, signal?: AbortSignal): Promise<TestRunResultV1>;\n}\n\nexport interface TestRunnerDeterministicFixtureV1 {\n\treadonly workspaceRef: string;\n\treadonly framework: TestRunnerFrameworkV1;\n\treadonly target: string;\n\treadonly result: TestRunnerCommandResultV1;\n}\n\nexport interface TestRunnerPluginManifestV1 {\n\treadonly id: typeof TEST_RUNNER_PLUGIN_ID_V1;\n\treadonly pluginVersion: string;\n\treadonly apiVersion: \"1\";\n\treadonly capabilityRefs: readonly { readonly id: \"test.run\"; readonly version: 1 }[];\n}\n"]}
package/dist/types.js ADDED
@@ -0,0 +1,5 @@
1
+ export const TEST_RUNNER_PLUGIN_ID_V1 = "agent-forge.plugin.test-runner";
2
+ export const TEST_RUNNER_CAPABILITY_VERSION_V1 = 1;
3
+ export const TEST_RUNNER_HOST_ADAPTER_ID_V1 = "node-test-runner";
4
+ export const TEST_RUNNER_HOST_ADAPTER_VERSION_V1 = "1.0.0";
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,wBAAwB,GAAG,gCAAyC,CAAC;AAClF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAU,CAAC;AAC5D,MAAM,CAAC,MAAM,8BAA8B,GAAG,kBAA2B,CAAC;AAC1E,MAAM,CAAC,MAAM,mCAAmC,GAAG,OAAgB,CAAC","sourcesContent":["import type { PluginErrorV1, PluginResultStatusV1 } from \"@agent-forge/plugin-sdk\";\n\nexport const TEST_RUNNER_PLUGIN_ID_V1 = \"agent-forge.plugin.test-runner\" as const;\nexport const TEST_RUNNER_CAPABILITY_VERSION_V1 = 1 as const;\nexport const TEST_RUNNER_HOST_ADAPTER_ID_V1 = \"node-test-runner\" as const;\nexport const TEST_RUNNER_HOST_ADAPTER_VERSION_V1 = \"1.0.0\" as const;\n\nexport type TestRunnerFrameworkV1 = \"vitest\" | \"jest\" | \"node-test\" | \"pytest\";\n\nexport interface TestRunRequestV1 {\n\treadonly version: 1;\n\treadonly operationId: string;\n\t/** Opaque host-owned workspace handle, never a local path. */\n\treadonly workspaceRef: string;\n\treadonly framework: TestRunnerFrameworkV1;\n\t/** A framework-specific selector. The host converts this to fixed argv. */\n\treadonly target: string;\n\treadonly timeoutMs?: number;\n\treadonly maxFailures?: number;\n}\n\nexport interface TestRunSummaryV1 {\n\treadonly total: number;\n\treadonly passed: number;\n\treadonly failed: number;\n\treadonly skipped: number;\n\treadonly flaky: number;\n}\n\n/** A relative test identifier, not an absolute host path or a raw stack trace. */\nexport interface TestRunFailureV1 {\n\treadonly file: string;\n\treadonly line?: number;\n\treadonly column?: number;\n\treadonly message: string;\n}\n\n/**\n * Structured model-facing test result. Full framework stdout/stderr stays in\n * host-owned reports and is never part of this DTO.\n */\nexport interface TestRunResultV1 {\n\treadonly version: 1;\n\treadonly operationId: string;\n\treadonly status: PluginResultStatusV1;\n\treadonly summary: TestRunSummaryV1;\n\treadonly failures: readonly TestRunFailureV1[];\n\treadonly failuresTruncated: boolean;\n\treadonly exitCode?: number;\n\treadonly reportArtifactRef?: string;\n\treadonly error?: PluginErrorV1;\n}\n\n/** A command identity and argv resolved exclusively by the host. */\nexport interface TestRunnerCommandV1 {\n\treadonly commandId: string;\n\treadonly args: readonly string[];\n}\n\nexport interface TestRunnerCommandResolverV1 {\n\tresolve(request: TestRunRequestV1, signal?: AbortSignal): Promise<TestRunnerCommandV1 | undefined>;\n}\n\n/** The runner owns executable path, cwd, environment, parsing, and raw logs. */\nexport interface TestRunnerCommandRunnerV1 {\n\trun(input: {\n\t\treadonly command: TestRunnerCommandV1;\n\t\treadonly timeoutMs: number;\n\t\treadonly signal: AbortSignal;\n\t}): Promise<TestRunnerCommandResultV1>;\n}\n\n/** Host-private parsed result. It intentionally has no stdout/stderr fields. */\nexport type TestRunnerCommandResultV1 =\n\t| {\n\t\t\treadonly status: \"completed\";\n\t\t\treadonly exitCode: number;\n\t\t\treadonly summary: TestRunSummaryV1;\n\t\t\treadonly failures?: readonly TestRunFailureV1[];\n\t\t\treadonly reportArtifactRef?: string;\n\t }\n\t| { readonly status: \"unsupported\" };\n\nexport interface TestRunnerAdapterV1 {\n\treadonly adapterId: string;\n\treadonly adapterVersion: string;\n\trun(request: TestRunRequestV1, signal?: AbortSignal): Promise<TestRunResultV1>;\n}\n\nexport interface TestRunnerDeterministicFixtureV1 {\n\treadonly workspaceRef: string;\n\treadonly framework: TestRunnerFrameworkV1;\n\treadonly target: string;\n\treadonly result: TestRunnerCommandResultV1;\n}\n\nexport interface TestRunnerPluginManifestV1 {\n\treadonly id: typeof TEST_RUNNER_PLUGIN_ID_V1;\n\treadonly pluginVersion: string;\n\treadonly apiVersion: \"1\";\n\treadonly capabilityRefs: readonly { readonly id: \"test.run\"; readonly version: 1 }[];\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@ai-agent-forge/plugin-test-runner",
3
+ "version": "0.85.0",
4
+ "description": "Test runner capability plugin for Agent Forge (full-control test_run tool over vitest/jest/node-test/pytest)",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "agent-forge.json",
17
+ "plugin.json",
18
+ "README.md"
19
+ ],
20
+ "scripts": {
21
+ "clean": "shx rm -rf dist",
22
+ "build": "tsgo -p tsconfig.build.json",
23
+ "test": "vitest --run",
24
+ "prepublishOnly": "npm run clean && npm run build"
25
+ },
26
+ "keywords": [
27
+ "agent-forge",
28
+ "plugin",
29
+ "test",
30
+ "runner"
31
+ ],
32
+ "author": "Agent Forge contributors",
33
+ "license": "MIT",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "git+https://github.com/agent-forge/agent-forge.git",
37
+ "directory": "plugins/test-runner"
38
+ },
39
+ "bugs": {
40
+ "url": "https://github.com/agent-forge/agent-forge/issues"
41
+ },
42
+ "homepage": "https://github.com/agent-forge/agent-forge#readme",
43
+ "engines": {
44
+ "node": ">=22.19.0"
45
+ },
46
+ "dependencies": {
47
+ "@agent-forge/plugin-sdk": "^0.85.0",
48
+ "typebox": "1.3.27"
49
+ },
50
+ "devDependencies": {
51
+ "@agent-forge/agent-forge": "^0.85.0",
52
+ "shx": "0.4.0",
53
+ "vitest": "4.1.9"
54
+ }
55
+ }
package/plugin.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "id": "agent-forge.plugin.test-runner",
3
+ "version": "0.84.4",
4
+ "apiVersion": "1-draft",
5
+ "entry": "./dist/entry.js",
6
+ "hostVersion": ">=0.84.4",
7
+ "requiredCapabilities": ["tools"],
8
+ "provides": [{ "id": "test.run", "version": 1, "kind": "contribution" }]
9
+ }