replicas-engine 0.1.1687 → 0.1.1688

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.
@@ -8,13 +8,13 @@ import {
8
8
  listCodexModelsForDetails,
9
9
  restartCodexAspHost,
10
10
  restartCodexAspHostIfRunning
11
- } from "./chunk-NR6MTHUJ.js";
12
- import "./chunk-NYAS7KNX.js";
13
- import "./chunk-67ZXXRJ5.js";
14
- import "./chunk-JNVXGKRR.js";
15
- import "./chunk-IL6OBS3T.js";
11
+ } from "./chunk-PSCQSFAO.js";
12
+ import "./chunk-7PMLZC3V.js";
13
+ import "./chunk-EKP2WDE7.js";
14
+ import "./chunk-QQ46DGF7.js";
15
+ import "./chunk-OWOVJSPF.js";
16
16
  import "./chunk-UZSNFLDQ.js";
17
- import "./chunk-25TILJOA.js";
17
+ import "./chunk-NFRBKHVR.js";
18
18
  import "./chunk-VEQXQN22.js";
19
19
  export {
20
20
  CODEX_ULTRAFAST_SERVICE_TIER,
@@ -5,7 +5,7 @@ import {
5
5
  ENGINE_ENV,
6
6
  monolithRequest,
7
7
  runGitCommand
8
- } from "./chunk-67ZXXRJ5.js";
8
+ } from "./chunk-EKP2WDE7.js";
9
9
  import {
10
10
  COMMAND_PROTECTION_MAX_MESSAGE_FILE_BYTES,
11
11
  COMMAND_PROTECTION_REPO_GIT_ARGS,
@@ -18,7 +18,7 @@ import {
18
18
  parseCommandProtectionRequest,
19
19
  toCommandProtectionRepoState,
20
20
  withRetry
21
- } from "./chunk-25TILJOA.js";
21
+ } from "./chunk-NFRBKHVR.js";
22
22
 
23
23
  // src/services/command-protection-service.ts
24
24
  import { readFile, stat } from "fs/promises";
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  SUBAGENT_MCP_TOOL_NAMES
6
- } from "./chunk-25TILJOA.js";
6
+ } from "./chunk-NFRBKHVR.js";
7
7
 
8
8
  // src/managers/subagent-mcp-config.ts
9
9
  import { existsSync } from "fs";
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  SUBPROCESS_MAX_BUFFER,
6
6
  execFileAsync
7
- } from "./chunk-IL6OBS3T.js";
7
+ } from "./chunk-OWOVJSPF.js";
8
8
  import {
9
9
  isRecord
10
10
  } from "./chunk-UZSNFLDQ.js";
@@ -21,7 +21,7 @@ import {
21
21
  provisionedDeviceSchema,
22
22
  readReplicasRuntimeEnv,
23
23
  serializePosixEnvFile
24
- } from "./chunk-25TILJOA.js";
24
+ } from "./chunk-NFRBKHVR.js";
25
25
 
26
26
  // src/runtime-env-loader.ts
27
27
  import { readFileSync } from "fs";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-7ZDAVYTV.js";
7
7
  import {
8
8
  engineScriptProcess
9
- } from "./chunk-NYAS7KNX.js";
9
+ } from "./chunk-7PMLZC3V.js";
10
10
  import {
11
11
  isRecord
12
12
  } from "./chunk-UZSNFLDQ.js";
@@ -5,7 +5,7 @@ import {
5
5
  extractCommandProtectionCommandText,
6
6
  isRecord,
7
7
  parseCodeHostPrUrl
8
- } from "./chunk-25TILJOA.js";
8
+ } from "./chunk-NFRBKHVR.js";
9
9
 
10
10
  // src/services/published-pull-request-urls.ts
11
11
  function publishedPullRequestUrls(result) {
@@ -19984,8 +19984,10 @@ function parseReplicasEvents(events) {
19984
19984
  messages.push({
19985
19985
  id: typeof messageId === "string" ? messageId : `replicas-user-${String(payload.seq)}`,
19986
19986
  type: "user",
19987
- content: `${event.type === `${HARNESS_EVENT_TYPE_PREFIX}cancelled_message` ? "[Cancelled before it started]\n\n" : ""}${extractToolResultText(message2.content)}`,
19987
+ content: extractToolResultText(message2.content),
19988
19988
  ...images.length ? { images } : {},
19989
+ // Replicas history lists no senders, and only the sender is offered Send again. Sent messages stay without one: a subagent's assignment carries its owner's id.
19990
+ ...event.type === `${HARNESS_EVENT_TYPE_PREFIX}cancelled_message` ? { cancelled: true, ...typeof payload.userId === "string" ? { senderUserId: payload.userId } : {} } : {},
19989
19991
  timestamp: timestamp2
19990
19992
  });
19991
19993
  return;
@@ -20684,6 +20686,7 @@ function parseClaudeEvents(events, parentToolUseId) {
20684
20686
 
20685
20687
  // ../shared/src/display-message/parsers/index.ts
20686
20688
  var INTERRUPTION_DEDUP_WINDOW_MS = 15e3;
20689
+ var STOP_CLOCK_SKEW_MS = 5e3;
20687
20690
  function parseAgentEvents(events, agentType) {
20688
20691
  return withoutReplacedMessages(excludeQueuedAcceptedEvents(events, []), (segment) => parseProviderEvents(segment, agentType));
20689
20692
  }
@@ -20748,12 +20751,18 @@ function applyInterruptions(messages, events) {
20748
20751
  const result = [...messages];
20749
20752
  for (const event of events) {
20750
20753
  if (event.type !== CHAT_INTERRUPTED_EVENT_TYPE) continue;
20751
- insertDisplayMessageByTimestamp(result, {
20754
+ const interruption = {
20752
20755
  id: `interruption-${event.timestamp}`,
20753
20756
  type: "interruption",
20754
20757
  timestamp: event.timestamp,
20755
20758
  ...event.payload.steered === true ? { steered: true } : {}
20756
- });
20759
+ };
20760
+ insertDisplayMessageByTimestamp(result, interruption);
20761
+ const at = result.indexOf(interruption);
20762
+ const stoppedMs = parseTimestampMs(event.timestamp);
20763
+ let to = at;
20764
+ for (let previous = result[to - 1]; previous?.type === "user" && previous.cancelled && stoppedMs - parseTimestampMs(previous.timestamp) <= STOP_CLOCK_SKEW_MS; previous = result[to - 1]) to--;
20765
+ if (to < at) result.splice(to, 0, ...result.splice(at, 1));
20757
20766
  }
20758
20767
  let lastUserMs = null;
20759
20768
  let lastInterruption = null;
@@ -20851,12 +20860,12 @@ function filterDisplayMessages(messages, provider2) {
20851
20860
  strippedUserContents.set(msg.content, stripped);
20852
20861
  }
20853
20862
  const { content, files, walkthroughs, appshots, annotations } = stripped;
20854
- if (INTERRUPTED_MESSAGE_REGEX.test(content)) {
20863
+ if (!msg.cancelled && INTERRUPTED_MESSAGE_REGEX.test(content)) {
20855
20864
  return [{ id: msg.id, type: "interruption", timestamp: msg.timestamp }];
20856
20865
  }
20857
20866
  const cleaned = withoutAttachmentPlaceholder(content, Boolean(msg.images?.length || files.length));
20858
20867
  if (cleaned.length === 0 && !msg.images?.length && files.length === 0 && walkthroughs.length === 0 && appshots.length === 0 && annotations.length === 0) return [];
20859
- const origin = parseMessageOrigin(msg.content);
20868
+ const origin = msg.cancelled ? null : parseMessageOrigin(msg.content);
20860
20869
  if (cleaned === msg.content && !origin && files.length === 0 && walkthroughs.length === 0 && appshots.length === 0 && annotations.length === 0) return [msg];
20861
20870
  return [{
20862
20871
  ...msg,
@@ -21635,7 +21644,7 @@ async function withRetry(label, fn, options) {
21635
21644
  }
21636
21645
 
21637
21646
  // ../shared/src/tensorlake.ts
21638
- var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-20-v35";
21647
+ var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-20-v38";
21639
21648
  var TENSORLAKE_DISK_MB = 100 * 1024;
21640
21649
 
21641
21650
  // ../shared/src/egress.ts
@@ -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-25TILJOA.js";
6
+ } from "./chunk-NFRBKHVR.js";
7
7
 
8
8
  // src/utils/exec.ts
9
9
  import { exec, execFile } from "child_process";
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  subagentCodexMcpConfig
6
- } from "./chunk-NYAS7KNX.js";
6
+ } from "./chunk-7PMLZC3V.js";
7
7
  import {
8
8
  ENGINE_ENV,
9
9
  UNQUOTED_PATHS_CONFIG,
@@ -15,15 +15,15 @@ import {
15
15
  resolveDiffBase,
16
16
  runGitCommand,
17
17
  setAgentCredentialSnapshot
18
- } from "./chunk-67ZXXRJ5.js";
18
+ } from "./chunk-EKP2WDE7.js";
19
19
  import {
20
20
  AppServerProcess,
21
21
  buildCodexAgentEnv
22
- } from "./chunk-JNVXGKRR.js";
22
+ } from "./chunk-QQ46DGF7.js";
23
23
  import {
24
24
  SUBPROCESS_MAX_BUFFER,
25
25
  execFileAsync
26
- } from "./chunk-IL6OBS3T.js";
26
+ } from "./chunk-OWOVJSPF.js";
27
27
  import {
28
28
  isRecord
29
29
  } from "./chunk-UZSNFLDQ.js";
@@ -63,7 +63,7 @@ import {
63
63
  shrunkImageSize,
64
64
  splitManagerInstructions,
65
65
  withTimeout
66
- } from "./chunk-25TILJOA.js";
66
+ } from "./chunk-NFRBKHVR.js";
67
67
 
68
68
  // src/managers/codex-token-manager.ts
69
69
  import { promises as fs } from "fs";
@@ -463,7 +463,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
463
463
  await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
464
464
  await this.applyCredentialsResponse(data);
465
465
  setAgentCredentialSnapshot("codex", data);
466
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-WH3FDXCT.js");
466
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-ZQHJIZ66.js");
467
467
  await restartCodexAspHostIfRunning2();
468
468
  });
469
469
  await this.start(true);
@@ -485,7 +485,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
485
485
  const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
486
486
  await this.applyCredentialsResponse(data);
487
487
  if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
488
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-WH3FDXCT.js");
488
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-ZQHJIZ66.js");
489
489
  await restartCodexAspHostIfRunning2();
490
490
  }
491
491
  setAgentCredentialSnapshot("codex", data);
@@ -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-IL6OBS3T.js";
6
+ } from "./chunk-OWOVJSPF.js";
7
7
  import {
8
8
  isVersionBelow
9
- } from "./chunk-25TILJOA.js";
9
+ } from "./chunk-NFRBKHVR.js";
10
10
 
11
11
  // src/utils/codex-agent-env.ts
12
12
  function buildCodexAgentEnv(source = process.env) {
@@ -242,7 +242,7 @@ function getCodexModelProvider(method) {
242
242
  if (method === "foundry") return "azure";
243
243
  return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
244
244
  }
245
- var ENGINE_PACKAGE_VERSION = "0.1.1687";
245
+ var ENGINE_PACKAGE_VERSION = "0.1.1688";
246
246
  var INITIALIZE_METHOD = "initialize";
247
247
  var INITIALIZED_NOTIFICATION = "initialized";
248
248
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-7ZDAVYTV.js";
7
7
  import {
8
8
  AspClient
9
- } from "./chunk-JNVXGKRR.js";
9
+ } from "./chunk-QQ46DGF7.js";
10
10
  import {
11
11
  ASTER_BASE_URL,
12
12
  ASTER_PROVIDER,
@@ -18,7 +18,7 @@ import {
18
18
  isRecord,
19
19
  readOllamaAuthEnv,
20
20
  readOpenAICompatibleAuthEnv
21
- } from "./chunk-25TILJOA.js";
21
+ } from "./chunk-NFRBKHVR.js";
22
22
 
23
23
  // src/managers/codex-asp/notification-dispatch.ts
24
24
  var TURN_STARTED_METHOD = "turn/started";
@@ -4,15 +4,15 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  getManagedPiMcpServers,
6
6
  managedMcpServerProcess
7
- } from "./chunk-BXZA2HFS.js";
7
+ } from "./chunk-ID3TOAOH.js";
8
8
  import "./chunk-7ZDAVYTV.js";
9
- import "./chunk-NYAS7KNX.js";
9
+ import "./chunk-7PMLZC3V.js";
10
10
  import {
11
11
  isRecord
12
12
  } from "./chunk-UZSNFLDQ.js";
13
13
  import {
14
14
  rankToolsByQuery
15
- } from "./chunk-25TILJOA.js";
15
+ } from "./chunk-NFRBKHVR.js";
16
16
  import "./chunk-VEQXQN22.js";
17
17
 
18
18
  // src/codemode-mcp.ts
@@ -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-4WUIIT6Z.js";
7
- import "./chunk-67ZXXRJ5.js";
8
- import "./chunk-IL6OBS3T.js";
6
+ } from "./chunk-2FQOMURD.js";
7
+ import "./chunk-EKP2WDE7.js";
8
+ import "./chunk-OWOVJSPF.js";
9
9
  import {
10
10
  isRecord
11
11
  } from "./chunk-UZSNFLDQ.js";
12
- import "./chunk-25TILJOA.js";
12
+ import "./chunk-NFRBKHVR.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/command-protection-hook.ts
@@ -14,13 +14,13 @@ import {
14
14
  recoverCompletedTurn,
15
15
  spawnMuseMsp,
16
16
  startMuseSession
17
- } from "./chunk-XL3IOGIZ.js";
17
+ } from "./chunk-RECB5M3N.js";
18
18
  import "./chunk-7ZDAVYTV.js";
19
19
  import {
20
20
  AppServerProcess,
21
21
  buildCodexAgentEnv
22
- } from "./chunk-JNVXGKRR.js";
23
- import "./chunk-IL6OBS3T.js";
22
+ } from "./chunk-QQ46DGF7.js";
23
+ import "./chunk-OWOVJSPF.js";
24
24
  import {
25
25
  AGENT,
26
26
  OPENCODE_GO_PROVIDER,
@@ -30,7 +30,7 @@ import {
30
30
  headlessAgentUsagePath,
31
31
  isRecord,
32
32
  withTimeout
33
- } from "./chunk-25TILJOA.js";
33
+ } from "./chunk-NFRBKHVR.js";
34
34
  import "./chunk-VEQXQN22.js";
35
35
 
36
36
  // src/headless-agent.ts
package/dist/src/index.js CHANGED
@@ -90,12 +90,12 @@ import {
90
90
  import {
91
91
  getManagedPiMcpServers,
92
92
  managedMcpServerProcess
93
- } from "./chunk-BXZA2HFS.js";
93
+ } from "./chunk-ID3TOAOH.js";
94
94
  import {
95
95
  evaluateCommandProtection,
96
96
  extractToolCommand,
97
97
  reportCommandProtectionBlock
98
- } from "./chunk-4WUIIT6Z.js";
98
+ } from "./chunk-2FQOMURD.js";
99
99
  import {
100
100
  ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
101
101
  AGENT_MESSAGE_DELTA_METHOD,
@@ -129,7 +129,7 @@ import {
129
129
  spawnMuseMsp,
130
130
  startMuseSession,
131
131
  uuidV7
132
- } from "./chunk-XL3IOGIZ.js";
132
+ } from "./chunk-RECB5M3N.js";
133
133
  import {
134
134
  MUSE_AUTH_PATH,
135
135
  OPENCODE_AUTH_PATH,
@@ -137,7 +137,7 @@ import {
137
137
  } from "./chunk-7ZDAVYTV.js";
138
138
  import {
139
139
  publishedPullRequestUrls
140
- } from "./chunk-KNEA2XCI.js";
140
+ } from "./chunk-JRVPCYO2.js";
141
141
  import {
142
142
  ACCOUNT_RATE_LIMITS_READ_METHOD,
143
143
  AsyncLock,
@@ -214,12 +214,12 @@ import {
214
214
  transcriptSecrets,
215
215
  upsertCredentialFileLines,
216
216
  writeSecureCredentialFile
217
- } from "./chunk-NR6MTHUJ.js";
217
+ } from "./chunk-PSCQSFAO.js";
218
218
  import {
219
219
  SUBAGENT_MCP_TOOL_TIMEOUT_MS,
220
220
  engineScriptProcess,
221
221
  subagentMcpProcessConfig
222
- } from "./chunk-NYAS7KNX.js";
222
+ } from "./chunk-7PMLZC3V.js";
223
223
  import {
224
224
  ENGINE_ENV,
225
225
  UNQUOTED_PATHS_CONFIG,
@@ -230,17 +230,17 @@ import {
230
230
  resolveDiffBase,
231
231
  setAgentCredentialSnapshot,
232
232
  setLinearSessionId
233
- } from "./chunk-67ZXXRJ5.js";
233
+ } from "./chunk-EKP2WDE7.js";
234
234
  import {
235
235
  AspRequestTimeoutError,
236
236
  buildCodexAgentEnv,
237
237
  getCodexModelProvider
238
- } from "./chunk-JNVXGKRR.js";
238
+ } from "./chunk-QQ46DGF7.js";
239
239
  import {
240
240
  SUBPROCESS_MAX_BUFFER,
241
241
  execAsync,
242
242
  execFileAsync
243
- } from "./chunk-IL6OBS3T.js";
243
+ } from "./chunk-OWOVJSPF.js";
244
244
  import {
245
245
  isRecord
246
246
  } from "./chunk-UZSNFLDQ.js";
@@ -541,7 +541,7 @@ import {
541
541
  workspaceTokenRequestSchema,
542
542
  workspaceTokenResponseSchema,
543
543
  wrapInTag
544
- } from "./chunk-25TILJOA.js";
544
+ } from "./chunk-NFRBKHVR.js";
545
545
  import {
546
546
  __commonJS,
547
547
  __export,
@@ -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-KNEA2XCI.js";
6
+ } from "./chunk-JRVPCYO2.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-UZSNFLDQ.js";
10
10
  import {
11
11
  shouldRefreshPullRequests
12
- } from "./chunk-25TILJOA.js";
12
+ } from "./chunk-NFRBKHVR.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/services/post-tool-pr-notifier.ts
@@ -11,7 +11,7 @@ import {
11
11
  spawnSubagentRequestSchema,
12
12
  subagentResponseSchema,
13
13
  waitSubagentRequestSchema
14
- } from "./chunk-25TILJOA.js";
14
+ } from "./chunk-NFRBKHVR.js";
15
15
  import "./chunk-VEQXQN22.js";
16
16
 
17
17
  // src/subagent-mcp.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.1687",
3
+ "version": "0.1.1688",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",