@wix/pathgrade 0.34.0 → 0.35.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.
@@ -1,12 +1,13 @@
1
1
  import { BaseAgent, getRuntimeEnv, getWorkspacePath, } from '../../types.js';
2
2
  import { mountMcpForCodexAppServer } from '../../providers/mcp-runtime-mounting.js';
3
3
  import { assertMcpSecretReferencesReady } from '../../providers/mcp-config.js';
4
+ import { buildSummary, enrichSkillEvents, extractSkillNameFromPath, inferCodexExecAction, } from '../../tool-events.js';
4
5
  import { requireAskBusForLiveBatches, } from '../../sdk/ask-bus/bus.js';
5
6
  import { toAskUserToolEvent } from '../../sdk/ask-bus/projection.js';
6
7
  import { decideMcpToolCall, redactMcpSecrets, } from '../../sdk/mcp-safety.js';
7
8
  import { spawnAppServerTransport, } from './transport.js';
8
9
  import { normalizeUpstreamQuestion, toWireAnswerMap, } from './wire-translators.js';
9
- const DEFAULT_MODEL = 'gpt-5.3-codex';
10
+ const DEFAULT_MODEL = 'gpt-5.4';
10
11
  const TURN_COMPLETED_METHOD = 'turn/completed';
11
12
  function recordFromUnknown(value) {
12
13
  if (value && typeof value === 'object' && !Array.isArray(value)) {
@@ -40,6 +41,27 @@ function extractMcpToolApprovalRequest(params) {
40
41
  function parseToolNameFromApprovalMessage(message) {
41
42
  return message.match(/tool\s+"([^"]+)"/i)?.[1];
42
43
  }
44
+ function extractCommandActionSkillName(action) {
45
+ if (typeof action.path === 'string') {
46
+ const direct = extractSkillNameFromPath(action.path);
47
+ if (direct)
48
+ return direct;
49
+ const embedded = extractSkillNameFromText(action.path);
50
+ if (embedded)
51
+ return embedded;
52
+ }
53
+ return typeof action.command === 'string' ? extractSkillNameFromText(action.command) : undefined;
54
+ }
55
+ function extractSkillNameFromText(value) {
56
+ if (!value)
57
+ return undefined;
58
+ return value.match(/(?:^|[/\s"'])\.(?:agents|claude)\/skills\/([^/\s"']+)\/SKILL\.md(?:$|[\s"'])/)?.[1];
59
+ }
60
+ function extractSkillPathFromText(value) {
61
+ if (!value)
62
+ return undefined;
63
+ return value.match(/(?:^|[\s"'])(?<path>(?:\/|\.{1,2}\/)?[^\s"']*(?:\.agents|\.claude)\/skills\/[^/\s"']+\/SKILL\.md)(?:$|[\s"'])/)?.groups?.path;
64
+ }
43
65
  function projectItemIntoTurn(item, turn) {
44
66
  if (item.type === 'agentMessage') {
45
67
  const msg = item;
@@ -50,16 +72,40 @@ function projectItemIntoTurn(item, turn) {
50
72
  }
51
73
  if (item.type === 'commandExecution') {
52
74
  const cmd = item;
75
+ const action = inferCodexExecAction(cmd.command);
76
+ const skillPath = extractSkillPathFromText(cmd.command);
77
+ const args = {
78
+ command: cmd.command,
79
+ ...(skillPath ? { path: skillPath } : {}),
80
+ };
53
81
  turn.nonAskToolEvents.push({
54
- action: 'run_shell',
82
+ action,
55
83
  provider: 'codex',
56
84
  providerToolName: 'commandExecution',
57
85
  turnNumber: turn.turnNumber,
58
- arguments: { command: cmd.command },
59
- summary: `run_shell: ${cmd.command}`,
86
+ arguments: args,
87
+ summary: buildSummary(action, 'commandExecution', args),
60
88
  confidence: 'high',
61
89
  rawSnippet: JSON.stringify(cmd),
62
90
  });
91
+ const recordedSkills = new Set();
92
+ for (const action of cmd.commandActions ?? []) {
93
+ const skillName = extractCommandActionSkillName(action) ?? extractSkillNameFromText(cmd.command);
94
+ if (!skillName || recordedSkills.has(skillName))
95
+ continue;
96
+ recordedSkills.add(skillName);
97
+ turn.nonAskToolEvents.push({
98
+ action: 'use_skill',
99
+ provider: 'codex',
100
+ providerToolName: `commandExecution.commandActions.${action.type ?? 'unknown'}`,
101
+ turnNumber: turn.turnNumber,
102
+ arguments: { path: action.path, name: action.name },
103
+ summary: `use_skill ${skillName}`,
104
+ confidence: 'high',
105
+ rawSnippet: JSON.stringify(action),
106
+ skillName,
107
+ });
108
+ }
63
109
  return;
64
110
  }
65
111
  if (item.type === 'fileChange') {
@@ -515,7 +561,7 @@ function assembleTurnResult(args) {
515
561
  .snapshot()
516
562
  .filter((s) => askBatchIds.has(s.batchId))
517
563
  .map((s) => toAskUserToolEvent(s));
518
- const toolEvents = [...askEvents, ...activeTurn.nonAskToolEvents];
564
+ const toolEvents = enrichSkillEvents([...askEvents, ...activeTurn.nonAskToolEvents]);
519
565
  const rawOutput = exitCode === 0
520
566
  ? message
521
567
  : [
@@ -142,9 +142,11 @@ function quoteCodexConfigString(value) {
142
142
  }
143
143
  export function buildAppServerSpawnArgs(args = [], env = process.env) {
144
144
  const baseUrl = env.OPENAI_BASE_URL?.trim();
145
+ const requestUserInputConfig = ['-c', 'features.default_mode_request_user_input=true'];
145
146
  if (!baseUrl)
146
- return [...args, 'app-server'];
147
+ return [...requestUserInputConfig, ...args, 'app-server'];
147
148
  return [
149
+ ...requestUserInputConfig,
148
150
  '-c', `model_provider=${quoteCodexConfigString(CODEX_PROXY_PROVIDER_ID)}`,
149
151
  '-c', `model_providers.${CODEX_PROXY_PROVIDER_ID}.name=${quoteCodexConfigString('PathGrade OpenAI Proxy')}`,
150
152
  '-c', `model_providers.${CODEX_PROXY_PROVIDER_ID}.base_url=${quoteCodexConfigString(baseUrl)}`,
@@ -26,7 +26,7 @@ export class CodexAgent extends TranscriptAgent {
26
26
  };
27
27
  }
28
28
  }
29
- const DEFAULT_CODEX_MODEL = 'gpt-5.3-codex';
29
+ const DEFAULT_CODEX_MODEL = 'gpt-5.4';
30
30
  const CODEX_PROXY_PROVIDER_ID = 'pathgrade_openai_proxy';
31
31
  function buildCodexExecCommand(promptPath, model = DEFAULT_CODEX_MODEL) {
32
32
  const quotedPromptPath = JSON.stringify(promptPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/pathgrade",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "Evaluate whether AI agents discover and use your skills correctly",
5
5
  "main": "./dist/sdk/index.js",
6
6
  "types": "./dist/sdk/index.d.ts",
@@ -97,5 +97,5 @@
97
97
  "typescript": "^5.9.3",
98
98
  "zod": "4.3.6"
99
99
  },
100
- "falconPackageHash": "77ac8633dc5bff7dea81e34b2bad4228699443f0788ce2eb56a2bc36"
100
+ "falconPackageHash": "7d7c65385d2ddc29c1b518b76ca8c6c57fd24241c74c182d1fd6fb56"
101
101
  }