@wix/pathgrade 1.0.23 → 1.0.24
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/dist/sdk/evaluate.js +2 -4
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.js +1 -0
- package/dist/sdk/mcp-evidence.d.ts +2 -0
- package/dist/sdk/mcp-evidence.js +11 -0
- package/dist/sdk/snapshots.js +2 -3
- package/dist/tool-events.d.ts +5 -0
- package/dist/tool-events.js +5 -2
- package/package.json +2 -2
package/dist/sdk/evaluate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractSkillsFromLog } from '../tool-events.js';
|
|
1
|
+
import { extractSkillsFromLog, extractToolEventsFromLog } from '../tool-events.js';
|
|
2
2
|
import { getRuntime } from './eval-runtime.js';
|
|
3
3
|
import { emitEvalResult } from './result-capture.js';
|
|
4
4
|
import { runJudgePipeline } from './judge-pipeline.js';
|
|
@@ -34,9 +34,7 @@ export class EvalScorerError extends Error {
|
|
|
34
34
|
function makeEvaluateAgent() {
|
|
35
35
|
const conversationAttributed = new WeakSet();
|
|
36
36
|
return async function evaluateAgent(agent, scorers, opts) {
|
|
37
|
-
const toolEvents = agent.log
|
|
38
|
-
.filter((e) => e.type === 'tool_event' && e.tool_event)
|
|
39
|
-
.map((e) => e.tool_event);
|
|
37
|
+
const toolEvents = extractToolEventsFromLog(agent.log);
|
|
40
38
|
const ctx = {
|
|
41
39
|
workspace: agent.workspace,
|
|
42
40
|
log: agent.log,
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { runScorer } from './run-scorer.js';
|
|
|
14
14
|
export { previewReactions } from './reaction-preview.js';
|
|
15
15
|
export { setRuntime, resetRuntime } from './eval-runtime.js';
|
|
16
16
|
export { DEFAULT_COPY_IGNORE } from '../providers/copy-filter.js';
|
|
17
|
+
export { extractToolEventsFromLog } from '../tool-events.js';
|
|
17
18
|
export { createAskBus, requireAskBusForLiveBatches, AskBusTimeoutError } from './ask-bus/bus.js';
|
|
18
19
|
export { toAskUserToolEvent } from './ask-bus/projection.js';
|
|
19
20
|
export type { AskUserToolEvent, AskUserToolEventArguments, AskUserToolEventQuestionArgument, } from './ask-bus/projection.js';
|
package/dist/sdk/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export { runScorer } from './run-scorer.js';
|
|
|
14
14
|
export { previewReactions } from './reaction-preview.js';
|
|
15
15
|
export { setRuntime, resetRuntime } from './eval-runtime.js';
|
|
16
16
|
export { DEFAULT_COPY_IGNORE } from '../providers/copy-filter.js';
|
|
17
|
+
export { extractToolEventsFromLog } from '../tool-events.js';
|
|
17
18
|
export { createAskBus, requireAskBusForLiveBatches, AskBusTimeoutError } from './ask-bus/bus.js';
|
|
18
19
|
export { toAskUserToolEvent } from './ask-bus/projection.js';
|
|
19
20
|
export { buildAskBatchLogEntries } from './agent-result-log.js';
|
|
@@ -44,6 +44,8 @@ export interface ExpectedMcpToolCall {
|
|
|
44
44
|
serverName?: string;
|
|
45
45
|
toolName?: string;
|
|
46
46
|
status?: string;
|
|
47
|
+
invocation?: McpInvocationResult['invocation'];
|
|
48
|
+
outcome?: McpInvocationResult['outcome'];
|
|
47
49
|
argumentsContaining?: Record<string, unknown>;
|
|
48
50
|
}
|
|
49
51
|
export interface McpStartupStatusEvidence {
|
package/dist/sdk/mcp-evidence.js
CHANGED
|
@@ -127,6 +127,17 @@ function matchesMcpToolCall(call, expected) {
|
|
|
127
127
|
return false;
|
|
128
128
|
if (expected.status !== undefined && call.status !== expected.status)
|
|
129
129
|
return false;
|
|
130
|
+
if (expected.invocation !== undefined || expected.outcome !== undefined) {
|
|
131
|
+
const invocation = getMcpInvocation(call.event);
|
|
132
|
+
if (!invocation)
|
|
133
|
+
return false;
|
|
134
|
+
if (invocation.serverName !== call.serverName || invocation.toolName !== call.toolName)
|
|
135
|
+
return false;
|
|
136
|
+
if (expected.invocation !== undefined && invocation.invocation !== expected.invocation)
|
|
137
|
+
return false;
|
|
138
|
+
if (expected.outcome !== undefined && invocation.outcome !== expected.outcome)
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
130
141
|
if (expected.argumentsContaining && !containsArguments(call.arguments, expected.argumentsContaining)) {
|
|
131
142
|
return false;
|
|
132
143
|
}
|
package/dist/sdk/snapshots.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { extractToolEventsFromLog } from '../tool-events.js';
|
|
1
2
|
import { sanitizePersistenceValue } from '../tool-event-results.js';
|
|
2
3
|
import fs from 'fs-extra';
|
|
3
4
|
export const RUN_SNAPSHOT_VERSION = 2;
|
|
4
5
|
export function buildRunSnapshot(params) {
|
|
5
6
|
const { agent, messages, log, conversationResult, workspace, timestamp } = params;
|
|
6
|
-
const toolEvents = log
|
|
7
|
-
.filter((entry) => entry.type === 'tool_event' && entry.tool_event)
|
|
8
|
-
.map((entry) => entry.tool_event);
|
|
7
|
+
const toolEvents = extractToolEventsFromLog(log);
|
|
9
8
|
return sanitizePersistenceValue({
|
|
10
9
|
version: agent === 'opencode' ? 2 : 1,
|
|
11
10
|
timestamp: timestamp ?? new Date().toISOString(),
|
package/dist/tool-events.d.ts
CHANGED
|
@@ -59,6 +59,11 @@ export declare function extractSkillsFromLog(log: ReadonlyArray<{
|
|
|
59
59
|
type: string;
|
|
60
60
|
tool_event?: ToolEvent;
|
|
61
61
|
}>): string[];
|
|
62
|
+
/** Extract normalized tool events from a session log. */
|
|
63
|
+
export declare function extractToolEventsFromLog(log: ReadonlyArray<{
|
|
64
|
+
type: string;
|
|
65
|
+
tool_event?: ToolEvent;
|
|
66
|
+
}>): ToolEvent[];
|
|
62
67
|
/**
|
|
63
68
|
* Extract deduplicated skill names from tool events that have action 'use_skill'.
|
|
64
69
|
*/
|
package/dist/tool-events.js
CHANGED
|
@@ -93,10 +93,13 @@ export function buildSummary(action, toolName, args) {
|
|
|
93
93
|
* Filters for tool_event entries, then delegates to extractSkillsFromToolEvents.
|
|
94
94
|
*/
|
|
95
95
|
export function extractSkillsFromLog(log) {
|
|
96
|
-
|
|
96
|
+
return extractSkillsFromToolEvents(extractToolEventsFromLog(log));
|
|
97
|
+
}
|
|
98
|
+
/** Extract normalized tool events from a session log. */
|
|
99
|
+
export function extractToolEventsFromLog(log) {
|
|
100
|
+
return log
|
|
97
101
|
.filter((e) => e.type === 'tool_event' && e.tool_event != null)
|
|
98
102
|
.map((e) => e.tool_event);
|
|
99
|
-
return extractSkillsFromToolEvents(toolEvents);
|
|
100
103
|
}
|
|
101
104
|
/**
|
|
102
105
|
* Extract deduplicated skill names from tool events that have action 'use_skill'.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/pathgrade",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.24",
|
|
4
4
|
"packageManager": "yarn@4.12.0",
|
|
5
5
|
"description": "Evaluate whether AI agents discover and use your skills correctly",
|
|
6
6
|
"exports": {
|
|
@@ -140,5 +140,5 @@
|
|
|
140
140
|
"typescript": "^5.9.3",
|
|
141
141
|
"zod": "4.3.6"
|
|
142
142
|
},
|
|
143
|
-
"falconPackageHash": "
|
|
143
|
+
"falconPackageHash": "45feda0f936d0f7a5e2c85b4b55cd80ebe1f411b76a3c5c38b3fc149"
|
|
144
144
|
}
|