@wix/pathgrade 0.37.0 → 1.0.1

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 (119) hide show
  1. package/README.md +116 -32
  2. package/dist/adapter-kit/index.d.ts +17 -0
  3. package/dist/adapter-kit/index.js +14 -0
  4. package/dist/adapters/jest/index.d.ts +3 -0
  5. package/dist/adapters/jest/index.js +3 -0
  6. package/dist/adapters/jest/invocation-adapter.d.ts +15 -0
  7. package/dist/adapters/jest/invocation-adapter.js +115 -0
  8. package/dist/adapters/jest/lifecycle.d.ts +21 -0
  9. package/dist/adapters/jest/lifecycle.js +62 -0
  10. package/dist/adapters/jest/metadata.d.ts +6 -0
  11. package/dist/adapters/jest/metadata.js +35 -0
  12. package/dist/adapters/jest/reporter.cjs +10 -0
  13. package/dist/adapters/jest/reporter.d.ts +5 -0
  14. package/dist/adapters/jest/reporter.js +67 -0
  15. package/dist/adapters/jest/results.d.ts +31 -0
  16. package/dist/adapters/jest/results.js +144 -0
  17. package/dist/adapters/jest/runner-adapter.d.ts +9 -0
  18. package/dist/adapters/jest/runner-adapter.js +49 -0
  19. package/dist/adapters/jest/setup.d.ts +1 -0
  20. package/dist/adapters/jest/setup.js +10 -0
  21. package/dist/adapters/node-test/index.d.ts +8 -0
  22. package/dist/adapters/node-test/index.js +106 -0
  23. package/dist/adapters/node-test/invocation-adapter.d.ts +5 -0
  24. package/dist/adapters/node-test/invocation-adapter.js +47 -0
  25. package/dist/adapters/node-test/runner-adapter.d.ts +2 -0
  26. package/dist/adapters/node-test/runner-adapter.js +116 -0
  27. package/dist/adapters/vitest/index.d.ts +9 -0
  28. package/dist/adapters/vitest/index.js +82 -0
  29. package/dist/adapters/vitest/lifecycle.d.ts +24 -0
  30. package/dist/adapters/vitest/lifecycle.js +41 -0
  31. package/dist/adapters/vitest/reporter.d.ts +12 -0
  32. package/dist/adapters/vitest/reporter.js +75 -0
  33. package/dist/adapters/vitest/setup.d.ts +1 -0
  34. package/dist/adapters/vitest/setup.js +3 -0
  35. package/dist/agents/claude/sdk-options.js +6 -0
  36. package/dist/agents/codex-app-server/agent.js +5 -1
  37. package/dist/agents/codex-app-server/protocol/index.js +3 -3
  38. package/dist/agents/codex-app-server/turn-completion.d.ts +1 -0
  39. package/dist/agents/codex-app-server/turn-completion.js +9 -0
  40. package/dist/commands/affected.js +22 -15
  41. package/dist/commands/run-args.d.ts +4 -3
  42. package/dist/commands/run-args.js +12 -6
  43. package/dist/commands/run-changed.d.ts +4 -4
  44. package/dist/commands/run-changed.js +45 -58
  45. package/dist/config/pathgrade.d.ts +48 -0
  46. package/dist/config/pathgrade.js +204 -0
  47. package/dist/pathgrade.d.ts +2 -2
  48. package/dist/pathgrade.js +35 -34
  49. package/dist/plugin/index.d.ts +2 -9
  50. package/dist/plugin/index.js +1 -81
  51. package/dist/plugin/lifecycle.d.ts +1 -45
  52. package/dist/plugin/lifecycle.js +1 -146
  53. package/dist/plugin/reporter.d.ts +1 -37
  54. package/dist/plugin/reporter.js +1 -280
  55. package/dist/plugin/setup.d.ts +1 -1
  56. package/dist/plugin/setup.js +1 -3
  57. package/dist/providers/copy-filter.d.ts +5 -0
  58. package/dist/providers/copy-filter.js +9 -0
  59. package/dist/providers/credentials.js +1 -1
  60. package/dist/providers/sandbox-lifecycle.d.ts +22 -0
  61. package/dist/providers/sandbox-lifecycle.js +133 -0
  62. package/dist/providers/sandbox.js +4 -3
  63. package/dist/providers/workspace.js +4 -14
  64. package/dist/reporters/diagnostics.d.ts +2 -40
  65. package/dist/reporters/diagnostics.js +1 -80
  66. package/dist/reporters/report-summary.d.ts +6 -0
  67. package/dist/reporters/report-summary.js +29 -0
  68. package/dist/reporting/artifacts.d.ts +2 -0
  69. package/dist/reporting/artifacts.js +20 -0
  70. package/dist/reporting/core.d.ts +2 -0
  71. package/dist/reporting/core.js +173 -0
  72. package/dist/reporting/types.d.ts +57 -0
  73. package/dist/reporting/types.js +1 -0
  74. package/dist/reporting/vitest-edge.d.ts +1 -0
  75. package/dist/reporting/vitest-edge.js +1 -0
  76. package/dist/runners/adapter-loader.d.ts +17 -0
  77. package/dist/runners/adapter-loader.js +67 -0
  78. package/dist/runners/adapter.d.ts +65 -0
  79. package/dist/runners/adapter.js +1 -0
  80. package/dist/runners/invocation.d.ts +10 -0
  81. package/dist/runners/invocation.js +1 -0
  82. package/dist/runners/lifecycle-hooks.d.ts +2 -0
  83. package/dist/runners/lifecycle-hooks.js +18 -0
  84. package/dist/runners/model-builders.d.ts +4 -0
  85. package/dist/runners/model-builders.js +67 -0
  86. package/dist/runners/model-validation.d.ts +12 -0
  87. package/dist/runners/model-validation.js +213 -0
  88. package/dist/runners/model.d.ts +117 -0
  89. package/dist/runners/model.js +1 -0
  90. package/dist/runners/orchestrator.d.ts +30 -0
  91. package/dist/runners/orchestrator.js +74 -0
  92. package/dist/runners/report-projection.d.ts +6 -0
  93. package/dist/runners/report-projection.js +62 -0
  94. package/dist/runners/selection.d.ts +6 -0
  95. package/dist/runners/selection.js +10 -0
  96. package/dist/runners/vitest-adapter.d.ts +8 -0
  97. package/dist/runners/vitest-adapter.js +108 -0
  98. package/dist/runners/vitest-invocation.d.ts +10 -0
  99. package/dist/runners/vitest-invocation.js +44 -0
  100. package/dist/runners/vitest-lifecycle.d.ts +43 -0
  101. package/dist/runners/vitest-lifecycle.js +150 -0
  102. package/dist/sdk/agent.js +15 -16
  103. package/dist/sdk/case-context.d.ts +20 -0
  104. package/dist/sdk/case-context.js +31 -0
  105. package/dist/sdk/diagnostics.d.ts +40 -0
  106. package/dist/sdk/diagnostics.js +80 -0
  107. package/dist/sdk/eval-runtime.d.ts +4 -0
  108. package/dist/sdk/eval-runtime.js +11 -1
  109. package/dist/sdk/evaluate.js +2 -1
  110. package/dist/sdk/index.d.ts +2 -0
  111. package/dist/sdk/index.js +1 -0
  112. package/dist/sdk/lifecycle.d.ts +40 -0
  113. package/dist/sdk/lifecycle.js +170 -0
  114. package/dist/sdk/result-capture.d.ts +18 -0
  115. package/dist/sdk/result-capture.js +49 -0
  116. package/dist/sdk/types.d.ts +1 -1
  117. package/dist/types.d.ts +2 -2
  118. package/dist/utils/llm-providers/anthropic.js +9 -2
  119. package/package.json +56 -4
@@ -17,6 +17,7 @@ export { createAskBus, requireAskBusForLiveBatches, AskBusTimeoutError } from '.
17
17
  export { toAskUserToolEvent } from './ask-bus/projection.js';
18
18
  export type { AskUserToolEvent, AskUserToolEventArguments, AskUserToolEventQuestionArgument, } from './ask-bus/projection.js';
19
19
  export { buildAskBatchLogEntries } from './agent-result-log.js';
20
+ export { emitEvalResult, resetAllResultObserversForTests, resetUserResultObservers, subscribeToEvalResults, } from './result-capture.js';
20
21
  export { getAgentCapabilities } from './types.js';
21
22
  export type { AgentTransport, AgentCapabilities, AgentName, McpRunMode, McpSafetyOptions, McpToolPolicy, McpToolPolicyRule, } from './types.js';
22
23
  export type { AskBus, AskBatch, AskQuestion, AskOption, AskAnswer, AskResolution, AskBatchSnapshot, AskAnswerSnapshot, AskResolutionSnapshot, AskHandle, AskHandler, AskSource, AskLifecycle, AskAnswerSource, Unsubscribe as AskBusUnsubscribe, } from './ask-bus/types.js';
@@ -25,6 +26,7 @@ export type { ConversationWindow, ConversationWindowOptions } from './conversati
25
26
  export type { JudgePipelineOptions } from './judge-pipeline.js';
26
27
  export type { RunScorerOptions } from './run-scorer.js';
27
28
  export type { OnScorerErrorMode } from './evaluate.js';
29
+ export type { EvalResultEvent, EvalResultObserver, ResultObserverHandle, ResultObserverOptions, ResultObserverOwner, } from './result-capture.js';
28
30
  export type { RunSnapshot } from './snapshots.js';
29
31
  export type { ExpectedMcpStartupStatus, ExpectedMcpToolCall, McpStartupStatusEvidence, McpToolCallEvidence, } from './mcp-evidence.js';
30
32
  export type { McpPolicyDenialReason, McpToolCallRequest, McpToolPolicyDecision, } from './mcp-safety.js';
package/dist/sdk/index.js CHANGED
@@ -17,6 +17,7 @@ export { DEFAULT_COPY_IGNORE } from '../providers/copy-filter.js';
17
17
  export { createAskBus, requireAskBusForLiveBatches, AskBusTimeoutError } from './ask-bus/bus.js';
18
18
  export { toAskUserToolEvent } from './ask-bus/projection.js';
19
19
  export { buildAskBatchLogEntries } from './agent-result-log.js';
20
+ export { emitEvalResult, resetAllResultObserversForTests, resetUserResultObservers, subscribeToEvalResults, } from './result-capture.js';
20
21
  export { getAgentCapabilities } from './types.js';
21
22
  export { createLLMClient, ProviderNotSupportedError } from '../utils/llm.js';
22
23
  export { createMockLLM } from '../utils/llm-mocks.js';
@@ -0,0 +1,40 @@
1
+ import type { Agent, PathgradeTestMeta, RecordedEvalResult } from './types.js';
2
+ export type LifecycleAgentOwner = {
3
+ type: 'runner-case';
4
+ caseId: string;
5
+ } | {
6
+ type: 'runner-suite-shared';
7
+ caseId: string;
8
+ } | {
9
+ type: 'manual';
10
+ };
11
+ type ResultAttribution = {
12
+ type: 'runner-case';
13
+ caseId: string;
14
+ } | {
15
+ type: 'unattributed-runner';
16
+ } | {
17
+ type: 'legacy-unowned';
18
+ };
19
+ interface FlushCaseInput {
20
+ caseId: string;
21
+ }
22
+ declare function getAgentOwner(agent: Agent): LifecycleAgentOwner | undefined;
23
+ declare function registerAgent(agent: Agent, owner?: LifecycleAgentOwner | null): void;
24
+ declare function untrackAgent(agent: Agent): void;
25
+ declare function releaseAgent(agent: Agent): void;
26
+ declare function recordResult(result: RecordedEvalResult, agent: Agent, attribution?: ResultAttribution): void;
27
+ declare function flushCase(input: FlushCaseInput): Promise<PathgradeTestMeta[]>;
28
+ declare function cleanupAll(): Promise<void>;
29
+ declare function reset(): void;
30
+ export declare const lifecycleCore: {
31
+ registerAgent: typeof registerAgent;
32
+ untrackAgent: typeof untrackAgent;
33
+ releaseAgent: typeof releaseAgent;
34
+ getAgentOwner: typeof getAgentOwner;
35
+ recordResult: typeof recordResult;
36
+ flushCase: typeof flushCase;
37
+ cleanupAll: typeof cleanupAll;
38
+ reset: typeof reset;
39
+ };
40
+ export {};
@@ -0,0 +1,170 @@
1
+ import { getCurrentCaseContext } from './case-context.js';
2
+ import { buildDiagnosticsReport } from './diagnostics.js';
3
+ const pendingAgents = new Set();
4
+ const agentOwners = new WeakMap();
5
+ const agentResults = new WeakMap();
6
+ function currentAgentOwner() {
7
+ const current = getCurrentCaseContext();
8
+ if (current.status !== 'active')
9
+ return { type: 'manual' };
10
+ return current.context.scope === 'runner-case'
11
+ ? { type: 'runner-case', caseId: current.context.caseId }
12
+ : { type: 'runner-suite-shared', caseId: current.context.caseId };
13
+ }
14
+ function belongsToCase(owner, caseId) {
15
+ return !owner || (owner.type === 'runner-case' && owner.caseId === caseId);
16
+ }
17
+ function canFlushResultsToCase(owner, caseId) {
18
+ if (!owner)
19
+ return true;
20
+ if (owner.type === 'runner-case')
21
+ return owner.caseId === caseId;
22
+ if (owner.type === 'runner-suite-shared')
23
+ return true;
24
+ return false;
25
+ }
26
+ function currentResultAttribution(owner) {
27
+ const current = getCurrentCaseContext();
28
+ if (current.status === 'active' && current.context.scope === 'runner-case') {
29
+ return { type: 'runner-case', caseId: current.context.caseId };
30
+ }
31
+ if (owner?.type === 'runner-case')
32
+ return { type: 'runner-case', caseId: owner.caseId };
33
+ if (!owner)
34
+ return { type: 'legacy-unowned' };
35
+ return { type: 'unattributed-runner' };
36
+ }
37
+ function getAgentOwner(agent) {
38
+ return agentOwners.get(agent);
39
+ }
40
+ function resultMatchesCase(entry, caseId) {
41
+ if (entry.attribution.type === 'runner-case')
42
+ return entry.attribution.caseId === caseId;
43
+ return entry.attribution.type === 'legacy-unowned';
44
+ }
45
+ function registerAgent(agent, owner) {
46
+ pendingAgents.add(agent);
47
+ const resolvedOwner = owner === undefined ? currentAgentOwner() : owner;
48
+ if (resolvedOwner) {
49
+ agentOwners.set(agent, resolvedOwner);
50
+ }
51
+ }
52
+ function untrackAgent(agent) {
53
+ pendingAgents.delete(agent);
54
+ }
55
+ function releaseAgent(agent) {
56
+ const owner = agentOwners.get(agent);
57
+ if (owner?.type !== 'manual')
58
+ return;
59
+ pendingAgents.delete(agent);
60
+ agentResults.delete(agent);
61
+ agentOwners.delete(agent);
62
+ }
63
+ function recordResult(result, agent, attribution) {
64
+ if (!agentResults.has(agent)) {
65
+ agentResults.set(agent, []);
66
+ }
67
+ const owner = agentOwners.get(agent);
68
+ const conversationEnd = [...agent.log].reverse().find((entry) => entry.type === 'conversation_end');
69
+ const completionReason = conversationEnd?.completion_reason ?? (agent.log.some((entry) => entry.type === 'agent_result') ? 'completed' : undefined);
70
+ agentResults.get(agent).push({
71
+ attribution: attribution ?? currentResultAttribution(owner),
72
+ meta: {
73
+ score: result.score,
74
+ scorers: result.scorers,
75
+ trial: result.trial,
76
+ diagnostics: buildDiagnosticsReport({
77
+ completionReason,
78
+ completionDetail: conversationEnd?.completion_detail,
79
+ turnDetails: conversationEnd?.turn_details,
80
+ reactionsFired: conversationEnd?.reactions_fired,
81
+ score: result.score,
82
+ scorers: result.scorers,
83
+ log: agent.log,
84
+ }),
85
+ },
86
+ });
87
+ }
88
+ async function flushCase(input) {
89
+ const results = [];
90
+ const toDispose = [];
91
+ for (const agent of pendingAgents) {
92
+ const owner = agentOwners.get(agent);
93
+ const belongsToThisCase = belongsToCase(owner, input.caseId);
94
+ const meta = agentResults.get(agent);
95
+ const matchingMeta = meta?.filter((entry) => resultMatchesCase(entry, input.caseId));
96
+ if (matchingMeta && matchingMeta.length > 0 && canFlushResultsToCase(owner, input.caseId)) {
97
+ results.push(...matchingMeta.map((entry) => entry.meta));
98
+ const remainingMeta = meta?.filter((entry) => !resultMatchesCase(entry, input.caseId)) ?? [];
99
+ if (remainingMeta.length > 0) {
100
+ agentResults.set(agent, remainingMeta);
101
+ }
102
+ else {
103
+ agentResults.delete(agent);
104
+ }
105
+ }
106
+ if (belongsToThisCase) {
107
+ const hasResultsForCase = matchingMeta && matchingMeta.length > 0;
108
+ if (!hasResultsForCase) {
109
+ const synthTrial = synthesizeTrialFromAgent(agent);
110
+ if (synthTrial) {
111
+ results.push(synthTrial);
112
+ }
113
+ }
114
+ pendingAgents.delete(agent);
115
+ agentOwners.delete(agent);
116
+ toDispose.push(agent);
117
+ }
118
+ }
119
+ await Promise.all(toDispose.map((agent) => agent.dispose().catch(() => { })));
120
+ return results;
121
+ }
122
+ function synthesizeTrialFromAgent(agent) {
123
+ if (agent.log.length === 0)
124
+ return null;
125
+ const nCommands = agent.log.filter((entry) => entry.type === 'command').length;
126
+ const tokenUsage = agent.llm.tokenUsage;
127
+ const conversationEnd = [...agent.log].reverse().find((entry) => entry.type === 'conversation_end');
128
+ const completionReason = conversationEnd?.completion_reason ?? (agent.log.some((entry) => entry.type === 'agent_result') ? 'completed' : undefined);
129
+ return {
130
+ score: 1,
131
+ scorers: [],
132
+ trial: {
133
+ trial_id: 0,
134
+ reward: 1,
135
+ scorer_results: [],
136
+ duration_ms: 0,
137
+ n_commands: nCommands,
138
+ input_tokens: tokenUsage?.inputTokens ?? 0,
139
+ output_tokens: tokenUsage?.outputTokens ?? 0,
140
+ session_log: [...agent.log],
141
+ },
142
+ diagnostics: buildDiagnosticsReport({
143
+ completionReason,
144
+ completionDetail: conversationEnd?.completion_detail,
145
+ turnDetails: conversationEnd?.turn_details,
146
+ reactionsFired: conversationEnd?.reactions_fired,
147
+ score: 1,
148
+ scorers: [],
149
+ log: agent.log,
150
+ }),
151
+ };
152
+ }
153
+ async function cleanupAll() {
154
+ const toDispose = [...pendingAgents];
155
+ pendingAgents.clear();
156
+ await Promise.all(toDispose.map((agent) => agent.dispose().catch(() => { })));
157
+ }
158
+ function reset() {
159
+ pendingAgents.clear();
160
+ }
161
+ export const lifecycleCore = {
162
+ registerAgent,
163
+ untrackAgent,
164
+ releaseAgent,
165
+ getAgentOwner,
166
+ recordResult,
167
+ flushCase,
168
+ cleanupAll,
169
+ reset,
170
+ };
@@ -0,0 +1,18 @@
1
+ import type { Agent, RecordedEvalResult } from './types.js';
2
+ export interface EvalResultEvent {
3
+ readonly result: RecordedEvalResult;
4
+ readonly agent: Agent;
5
+ }
6
+ export type EvalResultObserver = (event: EvalResultEvent) => void;
7
+ export type ResultObserverOwner = 'user' | 'adapter' | 'test';
8
+ export interface ResultObserverOptions {
9
+ readonly owner?: ResultObserverOwner;
10
+ readonly key?: string;
11
+ }
12
+ export interface ResultObserverHandle {
13
+ unsubscribe(): void;
14
+ }
15
+ export declare function subscribeToEvalResults(observer: EvalResultObserver, options?: ResultObserverOptions): ResultObserverHandle;
16
+ export declare function emitEvalResult(event: EvalResultEvent): void;
17
+ export declare function resetUserResultObservers(): void;
18
+ export declare function resetAllResultObserversForTests(): void;
@@ -0,0 +1,49 @@
1
+ const observers = new Set();
2
+ export function subscribeToEvalResults(observer, options = {}) {
3
+ if (options.owner === 'adapter' && options.key) {
4
+ removeObserverByOwnerAndKey(options.owner, options.key);
5
+ }
6
+ const subscription = {
7
+ observer,
8
+ owner: options.owner ?? 'user',
9
+ key: options.key,
10
+ };
11
+ observers.add(subscription);
12
+ let active = true;
13
+ return {
14
+ unsubscribe() {
15
+ if (!active)
16
+ return;
17
+ active = false;
18
+ observers.delete(subscription);
19
+ },
20
+ };
21
+ }
22
+ export function emitEvalResult(event) {
23
+ for (const subscription of [...observers]) {
24
+ try {
25
+ subscription.observer(event);
26
+ }
27
+ catch {
28
+ // Result capture should be best-effort for every observer; one
29
+ // broken hook must not block adapter-owned reporting.
30
+ }
31
+ }
32
+ }
33
+ export function resetUserResultObservers() {
34
+ for (const subscription of [...observers]) {
35
+ if (subscription.owner === 'user') {
36
+ observers.delete(subscription);
37
+ }
38
+ }
39
+ }
40
+ export function resetAllResultObserversForTests() {
41
+ observers.clear();
42
+ }
43
+ function removeObserverByOwnerAndKey(owner, key) {
44
+ for (const subscription of [...observers]) {
45
+ if (subscription.owner === owner && subscription.key === key) {
46
+ observers.delete(subscription);
47
+ }
48
+ }
49
+ }
@@ -2,7 +2,7 @@ import type { CommandResult, LogEntry } from '../types.js';
2
2
  import type { ToolAction } from '../tool-events.js';
3
3
  import type { MockMcpServerDescriptor } from '../core/mcp-mock.types.js';
4
4
  import type { TrialResult } from '../types.js';
5
- import type { DiagnosticsReport } from '../reporters/diagnostics.js';
5
+ import type { DiagnosticsReport } from './diagnostics.js';
6
6
  import type { LLMPort } from '../utils/llm-types.js';
7
7
  import type { McpSafetyOptions } from './mcp-safety.js';
8
8
  export type AgentName = 'claude' | 'codex' | 'cursor';
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { DiagnosticsReport } from './reporters/diagnostics.js';
1
+ import type { DiagnosticsReport } from './sdk/diagnostics.js';
2
2
  import type { RuntimePolicyDescriptor } from './sdk/runtime-policy.js';
3
3
  import type { LLMPort } from './utils/llm-types.js';
4
4
  export interface CommandResult {
@@ -230,7 +230,7 @@ export interface PathgradeSelectionReport {
230
230
  export interface PathgradeReport {
231
231
  version: 1;
232
232
  timestamp: string;
233
- /** `ci.threshold` from the plugin config, if configured. */
233
+ /** `ci.threshold` from Pathgrade config or legacy plugin config, if configured. */
234
234
  threshold?: number;
235
235
  /** Weighted average of every individual trial score across all groups. */
236
236
  overall_pass_rate: number;
@@ -1,8 +1,15 @@
1
1
  function getApiKey(env) {
2
- return env?.ANTHROPIC_API_KEY || process.env.ANTHROPIC_API_KEY;
2
+ return env?.ANTHROPIC_API_KEY
3
+ || env?.APP_ANTHROPIC_API_KEY
4
+ || process.env.ANTHROPIC_API_KEY
5
+ || process.env.APP_ANTHROPIC_API_KEY;
3
6
  }
4
7
  function resolveBaseUrl(env) {
5
- return env?.ANTHROPIC_BASE_URL || process.env.ANTHROPIC_BASE_URL || 'https://api.anthropic.com';
8
+ return env?.ANTHROPIC_BASE_URL
9
+ || env?.APP_ANTHROPIC_BASE_URL
10
+ || process.env.ANTHROPIC_BASE_URL
11
+ || process.env.APP_ANTHROPIC_BASE_URL
12
+ || 'https://api.anthropic.com';
6
13
  }
7
14
  function buildHeaders(apiKey, useCache) {
8
15
  const headers = {
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@wix/pathgrade",
3
- "version": "0.37.0",
3
+ "version": "1.0.1",
4
4
  "packageManager": "yarn@4.12.0",
5
5
  "description": "Evaluate whether AI agents discover and use your skills correctly",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/wix-incubator/pathgrade.git"
9
9
  },
10
+ "installConfig": {
11
+ "selfReferences": true
12
+ },
10
13
  "exports": {
11
14
  ".": {
12
15
  "types": "./dist/sdk/index.d.ts",
@@ -16,6 +19,34 @@
16
19
  "types": "./dist/plugin/index.d.ts",
17
20
  "default": "./dist/plugin/index.js"
18
21
  },
22
+ "./plugin/vitest": {
23
+ "types": "./dist/adapters/vitest/index.d.ts",
24
+ "default": "./dist/adapters/vitest/index.js"
25
+ },
26
+ "./adapters/vitest": {
27
+ "types": "./dist/adapters/vitest/index.d.ts",
28
+ "default": "./dist/adapters/vitest/index.js"
29
+ },
30
+ "./adapters/node-test": {
31
+ "types": "./dist/adapters/node-test/index.d.ts",
32
+ "default": "./dist/adapters/node-test/index.js"
33
+ },
34
+ "./adapters/jest": {
35
+ "types": "./dist/adapters/jest/index.d.ts",
36
+ "default": "./dist/adapters/jest/index.js"
37
+ },
38
+ "./adapters/jest/setup": {
39
+ "types": "./dist/adapters/jest/setup.d.ts",
40
+ "default": "./dist/adapters/jest/setup.js"
41
+ },
42
+ "./adapters/jest/reporter": {
43
+ "types": "./dist/adapters/jest/reporter.d.ts",
44
+ "default": "./dist/adapters/jest/reporter.cjs"
45
+ },
46
+ "./adapter-kit": {
47
+ "types": "./dist/adapter-kit/index.d.ts",
48
+ "default": "./dist/adapter-kit/index.js"
49
+ },
19
50
  "./mcp-mock": {
20
51
  "types": "./dist/core/mcp-mock.d.ts",
21
52
  "default": "./dist/core/mcp-mock.js"
@@ -25,6 +56,7 @@
25
56
  "bin": "bin/pathgrade.js",
26
57
  "files": [
27
58
  "dist/**/*.js",
59
+ "dist/**/*.cjs",
28
60
  "dist/**/*.d.ts",
29
61
  "dist/viewer.html",
30
62
  "!dist/**/*.js.map",
@@ -35,11 +67,20 @@
35
67
  "LICENSE"
36
68
  ],
37
69
  "scripts": {
38
- "test": "yarn build && vitest run",
70
+ "lint": "oxlint src tests evals examples scripts --deny-warnings --disable-unicorn-plugin --disable-oxc-plugin --allow no-unused-vars --allow no-underscore-dangle --allow no-shadow --allow preserve-caught-error --allow no-unsafe-optional-chaining --allow no-unreachable --ignore-pattern tests/fixtures --ignore-pattern .worktrees",
71
+ "knip": "yarn quality:deps",
72
+ "knip:unused": "knip --exclude binaries --no-config-hints --max-show-issues 20",
73
+ "quality:deps": "knip --dependencies --exclude binaries --no-config-hints --max-show-issues 20",
74
+ "quality:arch": "sentrux check .",
75
+ "quality:boundaries": "scripts/check-quality-boundaries.sh",
76
+ "quality:max-lines": "scripts/check-max-lines.sh .",
77
+ "quality": "yarn lint && yarn quality:deps && yarn quality:arch && yarn quality:boundaries && yarn quality:max-lines",
78
+ "test": "yarn build && vitest run && yarn test:runner-cli-smoke",
79
+ "test:runner-cli-smoke": "node tests/runner-cli-smoke/run-smokes.mjs",
39
80
  "test:evals": "vitest run --config evals/vitest.config.mts",
40
81
  "test:coverage": "vitest run --coverage",
41
82
  "dev": "tsx src/pathgrade.ts",
42
- "build": "tsc -p tsconfig.build.json && cp src/viewer.html dist/viewer.html"
83
+ "build": "tsc -p tsconfig.build.json && cp src/viewer.html dist/viewer.html && cp src/adapters/jest/reporter.cjs dist/adapters/jest/reporter.cjs"
43
84
  },
44
85
  "keywords": [
45
86
  "ai",
@@ -61,13 +102,23 @@
61
102
  "node": ">=20.11.0"
62
103
  },
63
104
  "peerDependencies": {
105
+ "jest": "^30.0.0",
64
106
  "vitest": "^4.0.0"
65
107
  },
108
+ "peerDependenciesMeta": {
109
+ "jest": {
110
+ "optional": true
111
+ },
112
+ "vitest": {
113
+ "optional": true
114
+ }
115
+ },
66
116
  "devDependencies": {
67
117
  "@types/fs-extra": "^11.0.4",
118
+ "@types/jest": "^30.0.0",
68
119
  "@types/picomatch": "^4.0.2",
69
120
  "@vitest/coverage-v8": "4.1.7",
70
- "tsx": "4.22.3",
121
+ "jest": "^30.0.0",
71
122
  "vitest": "4.1.7"
72
123
  },
73
124
  "dependencies": {
@@ -77,6 +128,7 @@
77
128
  "fs-extra": "11.3.3",
78
129
  "jiti": "2.6.1",
79
130
  "picomatch": "^4.0.4",
131
+ "tsx": "4.22.3",
80
132
  "typescript": "^5.9.3",
81
133
  "zod": "4.3.6"
82
134
  },