replicas-engine 0.1.1025 → 0.1.1027

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.
@@ -5,12 +5,12 @@ import {
5
5
  getCodexAspHost,
6
6
  restartCodexAspHost,
7
7
  restartCodexAspHostIfRunning
8
- } from "./chunk-4O34RLV4.js";
9
- import "./chunk-6QJUSUYT.js";
10
- import "./chunk-ABTNJPOU.js";
11
- import "./chunk-C5YKZO4K.js";
8
+ } from "./chunk-73446GJ3.js";
9
+ import "./chunk-QFJFKNXF.js";
10
+ import "./chunk-FOVYFK2H.js";
11
+ import "./chunk-IPL36DTU.js";
12
12
  import "./chunk-UZSNFLDQ.js";
13
- import "./chunk-MH345B4U.js";
13
+ import "./chunk-HLUAG4YU.js";
14
14
  import "./chunk-VEQXQN22.js";
15
15
  export {
16
16
  getCodexAspHost,
@@ -5,15 +5,15 @@ import {
5
5
  ENGINE_ENV,
6
6
  monolithRequest,
7
7
  setAgentCredentialSnapshot
8
- } from "./chunk-6QJUSUYT.js";
8
+ } from "./chunk-QFJFKNXF.js";
9
9
  import {
10
10
  AppServerProcess,
11
11
  buildCodexAgentEnv
12
- } from "./chunk-ABTNJPOU.js";
12
+ } from "./chunk-FOVYFK2H.js";
13
13
  import {
14
14
  SUBPROCESS_MAX_BUFFER,
15
15
  execFileAsync
16
- } from "./chunk-C5YKZO4K.js";
16
+ } from "./chunk-IPL36DTU.js";
17
17
  import {
18
18
  isRecord
19
19
  } from "./chunk-UZSNFLDQ.js";
@@ -28,7 +28,7 @@ import {
28
28
  listOpenAICompatibleModels,
29
29
  readOllamaAuthEnv,
30
30
  resolveOpenAICompatibleModelsUrl
31
- } from "./chunk-MH345B4U.js";
31
+ } from "./chunk-HLUAG4YU.js";
32
32
 
33
33
  // src/managers/codex-token-manager.ts
34
34
  import { promises as fs } from "fs";
@@ -264,7 +264,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
264
264
  await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
265
265
  await this.applyCredentialsResponse(data);
266
266
  setAgentCredentialSnapshot("codex", data);
267
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-HCKPHEGE.js");
267
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-R6LN7ANF.js");
268
268
  await restartCodexAspHostIfRunning2();
269
269
  });
270
270
  await this.start(true);
@@ -285,7 +285,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
285
285
  const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
286
286
  await this.applyCredentialsResponse(data);
287
287
  if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
288
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-HCKPHEGE.js");
288
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-R6LN7ANF.js");
289
289
  await restartCodexAspHostIfRunning2();
290
290
  }
291
291
  setAgentCredentialSnapshot("codex", data);
@@ -3,18 +3,18 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  monolithRequest
6
- } from "./chunk-6QJUSUYT.js";
6
+ } from "./chunk-QFJFKNXF.js";
7
7
  import {
8
8
  SUBPROCESS_MAX_BUFFER,
9
9
  execFileAsync
10
- } from "./chunk-C5YKZO4K.js";
10
+ } from "./chunk-IPL36DTU.js";
11
11
  import {
12
12
  extractCommandProtectionCommandText,
13
13
  findCommandProtectionGitLookups,
14
14
  findGitCommitSignals,
15
15
  findPrMergeSignals,
16
16
  parseCommandProtectionRequest
17
- } from "./chunk-MH345B4U.js";
17
+ } from "./chunk-HLUAG4YU.js";
18
18
 
19
19
  // src/services/command-protection-service.ts
20
20
  import { readFile, stat } from "fs/promises";
@@ -3,10 +3,10 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  execFileAsync
6
- } from "./chunk-C5YKZO4K.js";
6
+ } from "./chunk-IPL36DTU.js";
7
7
  import {
8
8
  isVersionBelow
9
- } from "./chunk-MH345B4U.js";
9
+ } from "./chunk-HLUAG4YU.js";
10
10
 
11
11
  // src/utils/codex-agent-env.ts
12
12
  function buildCodexAgentEnv(source = process.env) {
@@ -240,7 +240,7 @@ function getCodexModelProvider(method) {
240
240
  if (method === "foundry") return "azure";
241
241
  return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
242
242
  }
243
- var ENGINE_PACKAGE_VERSION = "0.1.1025";
243
+ var ENGINE_PACKAGE_VERSION = "0.1.1027";
244
244
  var INITIALIZE_METHOD = "initialize";
245
245
  var INITIALIZED_NOTIFICATION = "initialized";
246
246
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -1030,6 +1030,7 @@ function isCredentialScope(value) {
1030
1030
  function isAgentChatTurnActivityRecord(value) {
1031
1031
  return isAgentChatActivityRecord(value) && typeof value.turnId === "string" && typeof value.seconds === "number" && Number.isFinite(value.seconds) && value.seconds >= 0;
1032
1032
  }
1033
+ var SKILL_USE_KINDS = ["invoke", "read", "shell"];
1033
1034
  function isAgentChatActivityCallRecord(value) {
1034
1035
  return isAgentChatActivityRecord(value) && typeof value.callId === "string" && value.callId.length > 0;
1035
1036
  }
@@ -1039,7 +1040,7 @@ function isNamedAgentChatActivityRecord(value, field) {
1039
1040
  return typeof name === "string" && name.length > 0;
1040
1041
  }
1041
1042
  function isAgentChatSkillActivityRecord(value) {
1042
- return isNamedAgentChatActivityRecord(value, "skillName");
1043
+ return isNamedAgentChatActivityRecord(value, "skillName") && isRecord(value) && (value.useKind === void 0 || SKILL_USE_KINDS.some((kind) => kind === value.useKind));
1043
1044
  }
1044
1045
  function isAgentChatMcpActivityRecord(value) {
1045
1046
  return isNamedAgentChatActivityRecord(value, "mcpName");
@@ -2183,6 +2184,7 @@ function emit(scope, raw) {
2183
2184
  stdin,
2184
2185
  afterAnd: raw.afterAnd,
2185
2186
  stdinFile: stdinFile ? resolveShellPath(scope.dir, stdinFile.target) : null,
2187
+ stdinTarget: stdinFile?.target ?? null,
2186
2188
  writes: raw.redirects.flatMap(({ op, target }) => /^(?:1?>|1?>\||1?>>|&>|&>>|>&)$/.test(op) && !/^(?:\d+|-)$/.test(target) ? [{ path: resolveShellPath(scope.dir, target), target, content: output, append: op.endsWith(">>") }] : []),
2187
2189
  wrapper: script !== void 0,
2188
2190
  truncated,
@@ -2445,42 +2447,29 @@ function parseSkillName(tool, input) {
2445
2447
  return typeof skillName === "string" && skillName ? skillName : null;
2446
2448
  }
2447
2449
  function skillNameFromFilePath(path) {
2448
- const skillName = skillNameFromSkillRootPath(path);
2449
- if (skillName) return skillName;
2450
2450
  const parts = path.split(/[\\/]+/).filter(Boolean);
2451
2451
  if (parts.length < 2 || parts[parts.length - 1].toLowerCase() !== "skill.md") return null;
2452
- const fallbackSkillName = parts[parts.length - 2];
2453
- return fallbackSkillName && fallbackSkillName.toLowerCase() !== "skills" ? fallbackSkillName : null;
2452
+ const skillName = parts[parts.length - 2];
2453
+ return /[*?[\]{}…$]/.test(skillName) || ["skills", ".system"].includes(skillName.toLowerCase()) ? null : skillName;
2454
2454
  }
2455
- function skillNameFromSkillRootPath(path) {
2456
- const parts = path.split(/[\\/]+/).filter(Boolean);
2457
- const skillsIndex = parts.findLastIndex((part) => part.toLowerCase() === "skills");
2458
- if (skillsIndex === -1) return null;
2459
- const firstSkillPart = parts[skillsIndex + 1];
2460
- const skillName = firstSkillPart?.toLowerCase() === ".system" ? parts[skillsIndex + 2] : firstSkillPart;
2461
- return skillName && skillName.toLowerCase() !== "skill.md" ? skillName : null;
2462
- }
2463
- function parseSkillFilePath(input) {
2455
+ var READ_TOOL_NAMES = /* @__PURE__ */ new Set(["read", "read_file", "readfile", "view"]);
2456
+ function skillFilePath(tool, input) {
2457
+ if (!READ_TOOL_NAMES.has(tool.toLowerCase())) return null;
2464
2458
  const parsedInput = typeof input === "string" ? safeJsonParse(input, null) : input;
2465
2459
  if (!isRecord(parsedInput)) return null;
2466
2460
  const path = [parsedInput.path, parsedInput.filePath, parsedInput.file_path].find((value) => typeof value === "string" && value.length > 0);
2467
- if (!path) return null;
2468
- return skillNameFromFilePath(path);
2469
- }
2470
- function skillNameFromToolCall(tool, input) {
2471
- const directSkillName = parseSkillName(tool, input);
2472
- if (directSkillName) return directSkillName;
2473
- if (typeof tool !== "string" || !["read", "read_file", "readfile"].includes(tool.toLowerCase())) return null;
2474
- return parseSkillFilePath(input);
2461
+ return path && skillNameFromFilePath(path) ? path : null;
2475
2462
  }
2476
2463
  function createCallDisplayMessage(message2) {
2477
2464
  if (message2.inputRequest) return { ...message2, type: "tool_call" };
2478
- const skillName = message2.server.toLowerCase() === "skills" ? message2.tool : skillNameFromToolCall(message2.tool, message2.input);
2465
+ const path = skillFilePath(message2.tool, message2.input);
2466
+ const skillName = message2.server.toLowerCase() === "skills" ? message2.tool : path ? skillNameFromFilePath(path) : parseSkillName(message2.tool, message2.input);
2479
2467
  if (skillName === null) return { ...message2, type: "tool_call" };
2480
2468
  return {
2481
2469
  id: message2.id,
2482
2470
  type: "skill",
2483
2471
  skillName,
2472
+ ...path ? { path } : {},
2484
2473
  status: message2.status,
2485
2474
  timestamp: message2.timestamp
2486
2475
  };
@@ -2550,29 +2539,96 @@ function fileContentDiff(path, content, action) {
2550
2539
  ...lines.map((line) => `${action === "add" ? "+" : "-"}${line}`)
2551
2540
  ].join("\n");
2552
2541
  }
2542
+ var SEARCH_COMMANDS = /* @__PURE__ */ new Set(["grep", "rg"]);
2543
+ var OPTION_VALUE_FLAGS = /* @__PURE__ */ new Set([
2544
+ "-A",
2545
+ "-B",
2546
+ "-C",
2547
+ "-e",
2548
+ "-f",
2549
+ "-m",
2550
+ "--after-context",
2551
+ "--before-context",
2552
+ "--context",
2553
+ "--glob",
2554
+ "--max-count",
2555
+ "--regexp"
2556
+ ]);
2557
+ var LINE_COUNT_VALUE_FLAGS = /* @__PURE__ */ new Set([
2558
+ "-c",
2559
+ "-n",
2560
+ "--lines"
2561
+ ]);
2553
2562
  var SCRIPT_ROOT = "/";
2554
2563
  var commandName = (argv) => argv[0].split("/").pop() ?? argv[0];
2555
2564
  var fileWrites = ({ writes }) => writes.filter(({ path }) => path !== "/dev/null");
2556
2565
  function shellCommands(command) {
2557
2566
  return parseShellScript(command, SCRIPT_ROOT).filter(({ wrapper }) => !wrapper);
2558
2567
  }
2559
- function simpleCommands(command) {
2560
- const commands = shellCommands(command);
2561
- const hasRedirectOrSubshell = commands.some((shellCommand) => shellCommand.subshell || shellCommand.stdinFile !== null || !shellCommand.piped && shellCommand.stdin !== void 0 || fileWrites(shellCommand).length > 0);
2562
- if (commands.length === 0 || hasRedirectOrSubshell) return null;
2563
- return commands.map((shellCommand) => {
2564
- const argv = shellCommand.argv.map((word) => word.replaceAll(SHELL_OPAQUE, "\u2026"));
2565
- return { ...shellCommand, argv, name: commandName(argv) };
2566
- });
2567
- }
2568
+ var SKILL_READ_COMMANDS = /* @__PURE__ */ new Set(["awk", "bat", "cat", "head", "less", "more", "nl", "sed", "tail"]);
2568
2569
  function skillNamesFromCommand(command) {
2569
- const commands = simpleCommands(command);
2570
- if (!commands) return [];
2571
- return Array.from(new Set(commands.flatMap(({ argv }) => argv).flatMap((word) => {
2572
- const skillName = skillNameFromSkillRootPath(word);
2573
- return skillName ? [skillName] : [];
2570
+ return Array.from(new Set(shellCommands(command).flatMap((shellCommand) => {
2571
+ const argv = shellCommand.argv.map((word) => word.replaceAll(SHELL_OPAQUE, "\u2026"));
2572
+ const name = argv[0] ? commandName(argv) : "";
2573
+ if (!SKILL_READ_COMMANDS.has(name) || writesFiles(name, argv) || fileWrites(shellCommand).length > 0) return [];
2574
+ const paths = readCommandPaths(name, argv);
2575
+ const stdinTarget = shellCommand.stdinTarget?.replaceAll(SHELL_OPAQUE, "\u2026");
2576
+ return (paths.length === 0 && stdinTarget ? [stdinTarget] : paths).flatMap((path) => {
2577
+ const resolved = path.startsWith("~") ? path : resolveShellPath(shellCommand.dir, path)?.replace(SCRIPT_ROOT, "");
2578
+ const skillName = resolved && skillNameFromFilePath(resolved);
2579
+ return skillName ? [skillName] : [];
2580
+ });
2574
2581
  })));
2575
2582
  }
2583
+ function pathArgs(words, extraValueFlags) {
2584
+ const paths = [];
2585
+ for (let i = 0; i < words.length; i++) {
2586
+ const word = words[i];
2587
+ if (OPTION_VALUE_FLAGS.has(word) || extraValueFlags?.has(word)) {
2588
+ i++;
2589
+ continue;
2590
+ }
2591
+ if (word.startsWith("--glob=") || word.startsWith("--regexp=")) continue;
2592
+ if (word.startsWith("-")) continue;
2593
+ paths.push(word);
2594
+ }
2595
+ return Array.from(new Set(paths));
2596
+ }
2597
+ function readCommandPaths(command, words) {
2598
+ if (SEARCH_COMMANDS.has(command)) {
2599
+ const args = pathArgs(words.slice(1));
2600
+ return args.slice(1);
2601
+ }
2602
+ if (command === "sed") {
2603
+ const paths = [];
2604
+ let sawScript = false;
2605
+ for (let i = 1; i < words.length; i++) {
2606
+ const word = words[i];
2607
+ if (word === "-n" || word.startsWith("-n")) continue;
2608
+ if (word === "-e" || word === "-f" || word === "--expression" || word === "--file") {
2609
+ i++;
2610
+ sawScript = true;
2611
+ continue;
2612
+ }
2613
+ if (word.startsWith("--expression=") || word.startsWith("--file=")) {
2614
+ sawScript = true;
2615
+ continue;
2616
+ }
2617
+ if (word.startsWith("-")) continue;
2618
+ if (!sawScript) {
2619
+ sawScript = true;
2620
+ continue;
2621
+ }
2622
+ paths.push(word);
2623
+ }
2624
+ return Array.from(new Set(paths));
2625
+ }
2626
+ return pathArgs(words.slice(1), command === "head" || command === "tail" ? LINE_COUNT_VALUE_FLAGS : void 0);
2627
+ }
2628
+ function writesFiles(name, argv) {
2629
+ if (name === "sed") return argv.some((word) => /^(-[a-zA-Z]*i|--in-place)/.test(word));
2630
+ return name === "find" && argv.some((word) => /^-(exec|ok|delete|fprint|fls)/.test(word));
2631
+ }
2576
2632
 
2577
2633
  // ../shared/src/user-message-matching.ts
2578
2634
  function parseTimestampMs(timestamp) {
@@ -6652,15 +6708,14 @@ function parseClaudeEvents(events, parentToolUseId) {
6652
6708
  timestamp: event.timestamp
6653
6709
  });
6654
6710
  } else {
6655
- messages.push({
6711
+ messages.push(createCallDisplayMessage({
6656
6712
  id: `toolcall-${event.timestamp}-${messages.length}`,
6657
- type: "tool_call",
6658
6713
  server: "claude",
6659
6714
  tool: toolName,
6660
6715
  input: toolInput,
6661
6716
  status: "in_progress",
6662
6717
  timestamp: event.timestamp
6663
- });
6718
+ }));
6664
6719
  }
6665
6720
  }
6666
6721
  });
@@ -6807,6 +6862,8 @@ function parseClaudeEvents(events, parentToolUseId) {
6807
6862
  } else if (message2.type === "tool_call") {
6808
6863
  message2.output = resultContent;
6809
6864
  message2.status = status;
6865
+ } else if (message2.type === "skill" && isError && message2.path) {
6866
+ messages[toolInfo.messageIndex] = { id: message2.id, type: "tool_call", server: "claude", tool: toolInfo.toolName, input: toolInfo.input, output: resultContent, status, timestamp: message2.timestamp };
6810
6867
  } else if (message2.type === "skill") {
6811
6868
  message2.status = status;
6812
6869
  } else if (message2.type === "subagent") {
@@ -9280,6 +9337,7 @@ export {
9280
9337
  paginateChatHistory,
9281
9338
  coerceBackgroundTaskPayload,
9282
9339
  fileContentDiff,
9340
+ skillNamesFromCommand,
9283
9341
  areUserMessagesWithinMatchWindow,
9284
9342
  isGitHubUrl,
9285
9343
  parseCodeHostPrUrl,
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  HOOK_EXEC_MAX_BUFFER_BYTES
6
- } from "./chunk-MH345B4U.js";
6
+ } from "./chunk-HLUAG4YU.js";
7
7
 
8
8
  // src/utils/exec.ts
9
9
  import { exec, execFile } from "child_process";
@@ -14,7 +14,7 @@ import {
14
14
  isValidAgentProvider,
15
15
  parsePosixEnvFile,
16
16
  readReplicasRuntimeEnv
17
- } from "./chunk-MH345B4U.js";
17
+ } from "./chunk-HLUAG4YU.js";
18
18
 
19
19
  // src/runtime-env-loader.ts
20
20
  import { readFileSync } from "fs";
@@ -5,7 +5,7 @@ import {
5
5
  extractCommandProtectionCommandText,
6
6
  isRecord,
7
7
  parseCodeHostPrUrl
8
- } from "./chunk-MH345B4U.js";
8
+ } from "./chunk-HLUAG4YU.js";
9
9
 
10
10
  // src/services/published-pull-request-urls.ts
11
11
  function publishedPullRequestUrls(result) {
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  evaluateCommandProtection
6
- } from "./chunk-A6ZTEZQC.js";
7
- import "./chunk-6QJUSUYT.js";
8
- import "./chunk-C5YKZO4K.js";
6
+ } from "./chunk-7BKBAILL.js";
7
+ import "./chunk-QFJFKNXF.js";
8
+ import "./chunk-IPL36DTU.js";
9
9
  import {
10
10
  isRecord
11
11
  } from "./chunk-UZSNFLDQ.js";
12
- import "./chunk-MH345B4U.js";
12
+ import "./chunk-HLUAG4YU.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/command-protection-hook.ts
@@ -7,12 +7,12 @@ import {
7
7
  import {
8
8
  AppServerProcess,
9
9
  buildCodexAgentEnv
10
- } from "./chunk-ABTNJPOU.js";
11
- import "./chunk-C5YKZO4K.js";
10
+ } from "./chunk-FOVYFK2H.js";
11
+ import "./chunk-IPL36DTU.js";
12
12
  import {
13
13
  AGENT,
14
14
  headlessAgentRequestSchema
15
- } from "./chunk-MH345B4U.js";
15
+ } from "./chunk-HLUAG4YU.js";
16
16
  import "./chunk-VEQXQN22.js";
17
17
 
18
18
  // src/headless-agent.ts
package/dist/src/index.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  reportCommandProtectionBlock,
33
33
  resolveDiffBase,
34
34
  runGitCommand
35
- } from "./chunk-A6ZTEZQC.js";
35
+ } from "./chunk-7BKBAILL.js";
36
36
  import {
37
37
  ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
38
38
  AGENT_MESSAGE_DELTA_METHOD,
@@ -57,7 +57,7 @@ import {
57
57
  } from "./chunk-P73LGPQO.js";
58
58
  import {
59
59
  publishedPullRequestUrls
60
- } from "./chunk-TGJ5XL4O.js";
60
+ } from "./chunk-X5VJ2FDA.js";
61
61
  import {
62
62
  BaseRefreshManager,
63
63
  CodexAspAuthMethodChangedError,
@@ -71,7 +71,7 @@ import {
71
71
  refreshDelayMs,
72
72
  restartCodexAspHost,
73
73
  routineRefreshRequest
74
- } from "./chunk-4O34RLV4.js";
74
+ } from "./chunk-73446GJ3.js";
75
75
  import {
76
76
  ENGINE_ENV,
77
77
  monolithRequest,
@@ -79,16 +79,16 @@ import {
79
79
  readRuntimeEnvFile,
80
80
  reloadEngineEnv,
81
81
  setAgentCredentialSnapshot
82
- } from "./chunk-6QJUSUYT.js";
82
+ } from "./chunk-QFJFKNXF.js";
83
83
  import {
84
84
  AspClient,
85
85
  getCodexModelProvider
86
- } from "./chunk-ABTNJPOU.js";
86
+ } from "./chunk-FOVYFK2H.js";
87
87
  import {
88
88
  SUBPROCESS_MAX_BUFFER,
89
89
  execAsync,
90
90
  execFileAsync
91
- } from "./chunk-C5YKZO4K.js";
91
+ } from "./chunk-IPL36DTU.js";
92
92
  import {
93
93
  isRecord as isRecord2
94
94
  } from "./chunk-UZSNFLDQ.js";
@@ -306,6 +306,7 @@ import {
306
306
  serializeMuseAuthFile,
307
307
  shellQuotePosix,
308
308
  shouldRefreshPullRequests,
309
+ skillNamesFromCommand,
309
310
  spawnSubagentRequestSchema,
310
311
  stripAgentDiagnosticErrors,
311
312
  toClaudeCodeModel,
@@ -317,7 +318,7 @@ import {
317
318
  workspaceTokenRequestSchema,
318
319
  workspaceTokenResponseSchema,
319
320
  wrapInTag
320
- } from "./chunk-MH345B4U.js";
321
+ } from "./chunk-HLUAG4YU.js";
321
322
  import {
322
323
  cloneMcpConfig,
323
324
  ensureCompatibilityImports,
@@ -59085,24 +59086,27 @@ function mcpNameFromToolCall(message) {
59085
59086
  }
59086
59087
  return NON_MCP_SERVERS.has(message.server) ? null : message.server;
59087
59088
  }
59088
- function skillCallsFromCommand(message) {
59089
- const skillNames = message.skillNames ?? [];
59089
+ var SHELL_TOOL_NAMES = /^(bash|shell|run_shell_command)$/i;
59090
+ function skillCallsFromCommand(id, skillNames, occurredAt) {
59090
59091
  return skillNames.map((skillName, index) => ({
59091
59092
  kind: "skill",
59092
- id: skillNames.length === 1 ? message.id : `${message.id}-${index}`,
59093
+ id: skillNames.length === 1 ? id : `${id}-${index}`,
59093
59094
  skillName,
59094
- occurredAt: message.timestamp
59095
+ useKind: "shell",
59096
+ occurredAt
59095
59097
  }));
59096
59098
  }
59097
59099
  function extractSkillMcpCalls(messages) {
59098
59100
  return messages.flatMap((message) => {
59099
59101
  if (message.type === "skill") {
59100
- return [{ kind: "skill", id: message.id, skillName: message.skillName, occurredAt: message.timestamp }];
59102
+ return [{ kind: "skill", id: message.id, skillName: message.skillName, useKind: message.path ? "read" : "invoke", occurredAt: message.timestamp }];
59101
59103
  }
59102
59104
  if (message.type === "command") {
59103
- return skillCallsFromCommand(message);
59105
+ return skillCallsFromCommand(message.id, message.skillNames ?? [], message.timestamp);
59104
59106
  }
59105
59107
  if (message.type !== "tool_call") return [];
59108
+ const command = SHELL_TOOL_NAMES.test(message.tool) && isRecord(message.input) ? message.input.command ?? message.input.cmd : void 0;
59109
+ if (typeof command === "string") return skillCallsFromCommand(message.id, skillNamesFromCommand(command), message.timestamp);
59106
59110
  const mcpName = mcpNameFromToolCall(message);
59107
59111
  return mcpName ? [{ kind: "mcp", id: message.id, mcpName, occurredAt: message.timestamp }] : [];
59108
59112
  });
@@ -59240,8 +59244,9 @@ var AgentChatActivityTrackerService = class {
59240
59244
  const turn = this.turnActivityTracker.getActiveTurn(chatId);
59241
59245
  if (!turn) return;
59242
59246
  for (const call of extractSkillMcpCalls(messages)) {
59243
- if (turn.seenCallIds.has(call.id)) continue;
59244
- turn.seenCallIds.add(call.id);
59247
+ const key = call.kind !== "skill" ? call.id : `skill:${call.useKind === "invoke" && !call.skillName.startsWith(LEARNED_SKILL_DIR_PREFIX) ? LEARNED_SKILL_DIR_PREFIX : ""}${call.skillName}`;
59248
+ if (turn.seenCallIds.has(key)) continue;
59249
+ turn.seenCallIds.add(key);
59245
59250
  const activityRecord = {
59246
59251
  callId: call.id,
59247
59252
  chatId,
@@ -59255,7 +59260,8 @@ var AgentChatActivityTrackerService = class {
59255
59260
  if (call.kind === "skill") {
59256
59261
  this.skillActivityTracker.track(chatId, {
59257
59262
  ...activityRecord,
59258
- skillName: call.skillName
59263
+ skillName: call.skillName,
59264
+ useKind: call.useKind
59259
59265
  });
59260
59266
  } else {
59261
59267
  this.mcpActivityTracker.track(chatId, {
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  publishedPullRequestUrls
6
- } from "./chunk-TGJ5XL4O.js";
6
+ } from "./chunk-X5VJ2FDA.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-UZSNFLDQ.js";
10
10
  import {
11
11
  shouldRefreshPullRequests
12
- } from "./chunk-MH345B4U.js";
12
+ } from "./chunk-HLUAG4YU.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/services/post-tool-pr-notifier.ts
@@ -9,7 +9,7 @@ import {
9
9
  spawnSubagentRequestSchema,
10
10
  subagentResponseSchema,
11
11
  waitSubagentRequestSchema
12
- } from "./chunk-MH345B4U.js";
12
+ } from "./chunk-HLUAG4YU.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/subagent-mcp.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.1025",
3
+ "version": "0.1.1027",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",