@wix/pathgrade 1.0.24 → 1.0.26

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 (75) hide show
  1. package/README.md +42 -0
  2. package/dist/agents/claude/sdk-options.d.ts +1 -2
  3. package/dist/agents/claude.js +2 -1
  4. package/dist/agents/codex-app-server/agent.js +83 -46
  5. package/dist/agents/codex-app-server/scenario-mount.d.ts +40 -0
  6. package/dist/agents/codex-app-server/scenario-mount.js +238 -0
  7. package/dist/agents/cursor-scenario.d.ts +20 -0
  8. package/dist/agents/cursor-scenario.js +96 -0
  9. package/dist/agents/cursor.js +20 -0
  10. package/dist/agents/opencode/scenario.d.ts +25 -0
  11. package/dist/agents/opencode/scenario.js +195 -0
  12. package/dist/agents/opencode.js +50 -0
  13. package/dist/internal/direct-mcp-v2/acp-author-projector.d.ts +20 -0
  14. package/dist/internal/direct-mcp-v2/acp-author-projector.js +147 -0
  15. package/dist/internal/direct-mcp-v2/acp-author-session.d.ts +39 -0
  16. package/dist/internal/direct-mcp-v2/acp-author-session.js +201 -0
  17. package/dist/internal/direct-mcp-v2/acp-client.d.ts +70 -0
  18. package/dist/internal/direct-mcp-v2/acp-client.js +310 -0
  19. package/dist/internal/direct-mcp-v2/acp-direct-mcp.d.ts +38 -0
  20. package/dist/internal/direct-mcp-v2/acp-direct-mcp.js +326 -0
  21. package/dist/internal/direct-mcp-v2/claude-direct-mcp.d.ts +68 -0
  22. package/dist/internal/direct-mcp-v2/claude-direct-mcp.js +456 -0
  23. package/dist/internal/direct-mcp-v2/claude-profile.d.ts +9 -0
  24. package/dist/internal/direct-mcp-v2/claude-profile.js +97 -0
  25. package/dist/internal/direct-mcp-v2/cleanup.d.ts +62 -0
  26. package/dist/internal/direct-mcp-v2/cleanup.js +182 -0
  27. package/dist/internal/direct-mcp-v2/codex-direct-mcp.d.ts +41 -0
  28. package/dist/internal/direct-mcp-v2/codex-direct-mcp.js +436 -0
  29. package/dist/internal/direct-mcp-v2/codex-profile.d.ts +12 -0
  30. package/dist/internal/direct-mcp-v2/codex-profile.js +81 -0
  31. package/dist/internal/direct-mcp-v2/compiler.d.ts +12 -0
  32. package/dist/internal/direct-mcp-v2/compiler.js +449 -0
  33. package/dist/internal/direct-mcp-v2/cursor-direct-mcp.d.ts +14 -0
  34. package/dist/internal/direct-mcp-v2/cursor-direct-mcp.js +60 -0
  35. package/dist/internal/direct-mcp-v2/cursor-profile.d.ts +38 -0
  36. package/dist/internal/direct-mcp-v2/cursor-profile.js +79 -0
  37. package/dist/internal/direct-mcp-v2/evidence.d.ts +50 -0
  38. package/dist/internal/direct-mcp-v2/evidence.js +147 -0
  39. package/dist/internal/direct-mcp-v2/host-reducer.d.ts +61 -0
  40. package/dist/internal/direct-mcp-v2/host-reducer.js +214 -0
  41. package/dist/internal/direct-mcp-v2/json.d.ts +9 -0
  42. package/dist/internal/direct-mcp-v2/json.js +220 -0
  43. package/dist/internal/direct-mcp-v2/materialize.d.ts +39 -0
  44. package/dist/internal/direct-mcp-v2/materialize.js +22 -0
  45. package/dist/internal/direct-mcp-v2/opencode-direct-mcp.d.ts +14 -0
  46. package/dist/internal/direct-mcp-v2/opencode-direct-mcp.js +71 -0
  47. package/dist/internal/direct-mcp-v2/opencode-profile.d.ts +8 -0
  48. package/dist/internal/direct-mcp-v2/opencode-profile.js +52 -0
  49. package/dist/internal/direct-mcp-v2/projection.d.ts +40 -0
  50. package/dist/internal/direct-mcp-v2/projection.js +46 -0
  51. package/dist/internal/direct-mcp-v2/public-scenario-runtime.d.ts +51 -0
  52. package/dist/internal/direct-mcp-v2/public-scenario-runtime.js +353 -0
  53. package/dist/internal/direct-mcp-v2/runtime-lock.d.ts +51 -0
  54. package/dist/internal/direct-mcp-v2/runtime-lock.js +203 -0
  55. package/dist/internal/direct-mcp-v2/runtime-profile.d.ts +28 -0
  56. package/dist/internal/direct-mcp-v2/runtime-profile.js +163 -0
  57. package/dist/internal/direct-mcp-v2/scenario-http-host.d.ts +24 -0
  58. package/dist/internal/direct-mcp-v2/scenario-http-host.js +254 -0
  59. package/dist/internal/direct-mcp-v2/types.d.ts +233 -0
  60. package/dist/internal/direct-mcp-v2/types.js +1 -0
  61. package/dist/sdk/agent.js +57 -2
  62. package/dist/sdk/evaluate.js +6 -3
  63. package/dist/sdk/index.d.ts +4 -0
  64. package/dist/sdk/index.js +2 -0
  65. package/dist/sdk/managed-session.d.ts +6 -0
  66. package/dist/sdk/managed-session.js +157 -50
  67. package/dist/sdk/scenario-evidence.d.ts +27 -0
  68. package/dist/sdk/scenario-evidence.js +94 -0
  69. package/dist/sdk/scenario-machine-v2.d.ts +9 -0
  70. package/dist/sdk/scenario-machine-v2.js +37 -0
  71. package/dist/sdk/snapshots.d.ts +3 -0
  72. package/dist/sdk/snapshots.js +2 -0
  73. package/dist/sdk/types.d.ts +9 -1
  74. package/dist/types.d.ts +6 -0
  75. package/package.json +2 -2
@@ -0,0 +1,37 @@
1
+ import { compileScenario as compileInternalScenario } from '../internal/direct-mcp-v2/compiler.js';
2
+ import { canonicalJson, parseStrictJson } from '../internal/direct-mcp-v2/json.js';
3
+ const V2_CONCURRENCY_POLICY = 'poison-effectful-overlap';
4
+ function object(value) {
5
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
6
+ }
7
+ /** Compile the public V2 source contract, whose concurrency safety policy is fixed by the version. */
8
+ export function compileScenario(source) {
9
+ try {
10
+ canonicalJson(source);
11
+ }
12
+ catch (error) {
13
+ return { ok: false, diagnostics: [{ code: 'INVALID_JSON_VALUE', path: '$', message: error instanceof Error ? error.message : String(error) }] };
14
+ }
15
+ if (!object(source))
16
+ return compileInternalScenario(source);
17
+ const suppliedConcurrency = Object.prototype.hasOwnProperty.call(source, 'concurrency');
18
+ const compiled = compileInternalScenario({ ...source, concurrency: V2_CONCURRENCY_POLICY });
19
+ if (!suppliedConcurrency)
20
+ return compiled;
21
+ const diagnostic = { code: 'UNKNOWN_FIELD', path: '$/concurrency', message: 'unknown field concurrency' };
22
+ if (compiled.ok)
23
+ return { ok: false, diagnostics: [diagnostic] };
24
+ return {
25
+ ok: false,
26
+ diagnostics: [...compiled.diagnostics, diagnostic].sort((left, right) => canonicalJson(left).localeCompare(canonicalJson(right), 'en')),
27
+ };
28
+ }
29
+ /** Compile strict JSON text using the public V2 source contract. */
30
+ export function compileScenarioText(text) {
31
+ try {
32
+ return compileScenario(parseStrictJson(text));
33
+ }
34
+ catch (error) {
35
+ return { ok: false, diagnostics: [{ code: 'INVALID_JSON_TEXT', path: '$', message: error instanceof Error ? error.message : String(error) }] };
36
+ }
37
+ }
@@ -1,6 +1,7 @@
1
1
  import type { LogEntry } from '../types.js';
2
2
  import type { ToolEvent } from '../tool-events.js';
3
3
  import type { AgentName, ConversationResult, Message, TurnTiming } from './types.js';
4
+ import type { EvidenceEnvelope } from '../internal/direct-mcp-v2/types.js';
4
5
  export declare const RUN_SNAPSHOT_VERSION = 2;
5
6
  export interface RunSnapshot {
6
7
  version: 1 | 2;
@@ -17,6 +18,7 @@ export interface RunSnapshot {
17
18
  turnTimings: TurnTiming[];
18
19
  };
19
20
  workspace: string | null;
21
+ scenarioEvidence?: readonly EvidenceEnvelope[];
20
22
  }
21
23
  export declare function buildRunSnapshot(params: {
22
24
  agent: AgentName;
@@ -26,6 +28,7 @@ export declare function buildRunSnapshot(params: {
26
28
  workspace: string | null;
27
29
  timestamp?: string;
28
30
  sensitiveValues?: readonly string[];
31
+ scenarioEvidence?: readonly EvidenceEnvelope[];
29
32
  }): RunSnapshot;
30
33
  export declare class SnapshotParseError extends Error {
31
34
  constructor(message: string, options?: {
@@ -20,6 +20,7 @@ export function buildRunSnapshot(params) {
20
20
  turnTimings: [...conversationResult.turnTimings],
21
21
  },
22
22
  workspace,
23
+ ...(params.scenarioEvidence ? { scenarioEvidence: structuredClone(params.scenarioEvidence) } : {}),
23
24
  }, params.sensitiveValues);
24
25
  }
25
26
  export class SnapshotParseError extends Error {
@@ -153,5 +154,6 @@ function validateRunSnapshot(input) {
153
154
  turnTimings: snapshot.conversationResult.turnTimings,
154
155
  },
155
156
  workspace: typeof snapshot.workspace === 'string' ? snapshot.workspace : null,
157
+ scenarioEvidence: Array.isArray(snapshot.scenarioEvidence) ? snapshot.scenarioEvidence : [],
156
158
  };
157
159
  }
@@ -6,10 +6,12 @@ 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
  import type { McpMockApprovalRule } from './mcp-mock-approvals.js';
9
+ import type { EvidenceEnvelope } from '../internal/direct-mcp-v2/types.js';
10
+ import type { ScenarioMachineV2 } from './scenario-machine-v2.js';
9
11
  export type AgentName = 'claude' | 'codex' | 'cursor' | 'opencode';
10
12
  export type AgentInteractionMode = 'prompt' | 'start_chat' | 'conversation';
11
13
  /** Runtime channel that actually executed the agent. */
12
- export type AgentExecutionTransport = AgentTransport | 'claude-agent-sdk' | 'cursor-agent';
14
+ export type AgentExecutionTransport = AgentTransport | 'claude-agent-sdk' | 'cursor-agent' | 'acp';
13
15
  /** Privacy-safe execution dimensions exposed to result observers. */
14
16
  export interface AgentExecutionMetadata {
15
17
  name: AgentName;
@@ -29,6 +31,8 @@ export interface AgentOptions {
29
31
  copyFromHome?: string[];
30
32
  env?: Record<string, string>;
31
33
  mcpMock?: MockMcpServerDescriptor | MockMcpServerDescriptor[];
34
+ /** Host-authoritative direct MCP scenario for explicit Claude, Codex app-server, OpenCode, and admitted Cursor runtimes. */
35
+ mcpScenario?: ScenarioMachineV2;
32
36
  /** Ordered, persistent simulated-user decisions for approval-required generated MCP tools. */
33
37
  mcpMockApprovalRules?: McpMockApprovalRule[];
34
38
  mcpConfigFile?: string;
@@ -85,6 +89,8 @@ export interface Agent {
85
89
  readonly workspace: string;
86
90
  /** Provider/runtime metadata only; never contains prompts or paths. */
87
91
  readonly executionMetadata?: AgentExecutionMetadata;
92
+ /** Immutable canonical ScenarioMachineV2 evidence. Pathgrade agents return an empty array when no scenario is configured. */
93
+ readonly scenarioEvidence?: readonly EvidenceEnvelope[];
88
94
  dispose(): Promise<void>;
89
95
  }
90
96
  export interface ConverseOptions {
@@ -337,6 +343,8 @@ export interface ScorerContext {
337
343
  toolEvents: import('../tool-events.js').ToolEvent[];
338
344
  runCommand: (cmd: string) => Promise<CommandResult>;
339
345
  artifacts: SessionArtifacts;
346
+ /** Canonical host evidence for ScenarioMachineV2 scorers. */
347
+ scenarioEvidence?: readonly EvidenceEnvelope[];
340
348
  }
341
349
  export interface EvaluateOptions {
342
350
  failFast?: boolean;
package/dist/types.d.ts CHANGED
@@ -175,6 +175,8 @@ export interface TrialResult {
175
175
  */
176
176
  total_cost_usd?: number;
177
177
  session_log: LogEntry[];
178
+ /** Redacted canonical ScenarioMachineV2 evidence for offline scoring and audit. */
179
+ scenario_evidence?: readonly import('./internal/direct-mcp-v2/types.js').EvidenceEnvelope[];
178
180
  skills_used?: string[];
179
181
  diagnostics?: DiagnosticsReport;
180
182
  result_kind?: import('./sdk/types.js').EvaluationResultKind;
@@ -390,6 +392,10 @@ export interface AgentSessionOptions {
390
392
  opencodeMcpToolNames?: string[];
391
393
  /** Managed-session-owned runtime for scripted generated MCP. */
392
394
  scriptedMcpHost?: import('./providers/scripted-mcp-mock-host.js').ScriptedMcpMockHost;
395
+ /** Parent-owned public ScenarioMachineV2 bridge; never serialized into child config. */
396
+ scenarioMcpServers?: Record<string, import('@anthropic-ai/claude-agent-sdk').McpSdkServerConfigWithInstance>;
397
+ /** Parent-owned admitted Codex app-server mount; projected only into thread/start memory. */
398
+ codexScenarioMount?: import('./agents/codex-app-server/scenario-mount.js').CodexScenarioMount;
393
399
  /** Runtime-only values inherited by drivers and persistence sinks for redaction. */
394
400
  sensitiveValues?: readonly string[];
395
401
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/pathgrade",
3
- "version": "1.0.24",
3
+ "version": "1.0.26",
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": "45feda0f936d0f7a5e2c85b4b55cd80ebe1f411b76a3c5c38b3fc149"
143
+ "falconPackageHash": "23390180e5694ad3ec546fb637b601045310b46b4d7f10927a63e0db"
144
144
  }