replicas-engine 0.1.1707 → 0.1.1709

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-CL6PB6PK.js";
12
- import "./chunk-D2AYEOGN.js";
13
- import "./chunk-MQKLFCKW.js";
14
- import "./chunk-2WZAPABZ.js";
15
- import "./chunk-AHHPKYNJ.js";
11
+ } from "./chunk-O526LZXZ.js";
12
+ import "./chunk-GHCYFXYP.js";
13
+ import "./chunk-7DCGOTA6.js";
14
+ import "./chunk-SE7CCTGI.js";
15
+ import "./chunk-74BNGRCS.js";
16
16
  import "./chunk-UZSNFLDQ.js";
17
- import "./chunk-2GYFXGZB.js";
17
+ import "./chunk-W5ZWLGYO.js";
18
18
  import "./chunk-VEQXQN22.js";
19
19
  export {
20
20
  CODEX_ULTRAFAST_SERVICE_TIER,
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-7ZDAVYTV.js";
7
7
  import {
8
8
  engineScriptProcess
9
- } from "./chunk-D2AYEOGN.js";
9
+ } from "./chunk-GHCYFXYP.js";
10
10
  import {
11
11
  isRecord
12
12
  } from "./chunk-UZSNFLDQ.js";
@@ -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-2GYFXGZB.js";
6
+ } from "./chunk-W5ZWLGYO.js";
7
7
 
8
8
  // src/utils/exec.ts
9
9
  import { exec, execFile } from "child_process";
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  SUBPROCESS_MAX_BUFFER,
6
6
  execFileAsync
7
- } from "./chunk-AHHPKYNJ.js";
7
+ } from "./chunk-74BNGRCS.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-2GYFXGZB.js";
24
+ } from "./chunk-W5ZWLGYO.js";
25
25
 
26
26
  // src/runtime-env-loader.ts
27
27
  import { readFileSync } from "fs";
@@ -5,7 +5,7 @@ import {
5
5
  ENGINE_ENV,
6
6
  monolithRequest,
7
7
  runGitCommand
8
- } from "./chunk-MQKLFCKW.js";
8
+ } from "./chunk-7DCGOTA6.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-2GYFXGZB.js";
21
+ } from "./chunk-W5ZWLGYO.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-2GYFXGZB.js";
6
+ } from "./chunk-W5ZWLGYO.js";
7
7
 
8
8
  // src/managers/subagent-mcp-config.ts
9
9
  import { existsSync } from "fs";
@@ -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-D2AYEOGN.js";
6
+ } from "./chunk-GHCYFXYP.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-MQKLFCKW.js";
18
+ } from "./chunk-7DCGOTA6.js";
19
19
  import {
20
20
  AppServerProcess,
21
21
  buildCodexAgentEnv
22
- } from "./chunk-2WZAPABZ.js";
22
+ } from "./chunk-SE7CCTGI.js";
23
23
  import {
24
24
  SUBPROCESS_MAX_BUFFER,
25
25
  execFileAsync
26
- } from "./chunk-AHHPKYNJ.js";
26
+ } from "./chunk-74BNGRCS.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-2GYFXGZB.js";
66
+ } from "./chunk-W5ZWLGYO.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-FXHW3QQ3.js");
466
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-DYVCSRQL.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-FXHW3QQ3.js");
488
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-DYVCSRQL.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-AHHPKYNJ.js";
6
+ } from "./chunk-74BNGRCS.js";
7
7
  import {
8
8
  isVersionBelow
9
- } from "./chunk-2GYFXGZB.js";
9
+ } from "./chunk-W5ZWLGYO.js";
10
10
 
11
11
  // src/utils/codex-agent-env.ts
12
12
  function buildCodexAgentEnv(source = process.env) {
@@ -244,7 +244,7 @@ function getCodexModelProvider(method) {
244
244
  if (method === "foundry") return "azure";
245
245
  return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
246
246
  }
247
- var ENGINE_PACKAGE_VERSION = "0.1.1707";
247
+ var ENGINE_PACKAGE_VERSION = "0.1.1709";
248
248
  var INITIALIZE_METHOD = "initialize";
249
249
  var INITIALIZED_NOTIFICATION = "initialized";
250
250
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -5,7 +5,7 @@ import {
5
5
  extractCommandProtectionCommandText,
6
6
  isRecord,
7
7
  parseCodeHostPrUrl
8
- } from "./chunk-2GYFXGZB.js";
8
+ } from "./chunk-W5ZWLGYO.js";
9
9
 
10
10
  // src/services/published-pull-request-urls.ts
11
11
  function publishedPullRequestUrls(result) {
@@ -17378,7 +17378,7 @@ ${operation.diff}` : ""}`).join("\n\n");
17378
17378
  }
17379
17379
  if (message2.type === "harness_switch") return { kind: "error", title: describeHarnessSwitch(message2), summary: "", content: "" };
17380
17380
  if (message2.type === "interruption") return { kind: "error", title: "Agent stopped", summary: "", content: "" };
17381
- if (message2.type === "capacity_retry") return { kind: "task", title: "Model at capacity", summary: `Retry ${message2.attempt} of ${message2.maxAttempts}`, content: "" };
17381
+ if (message2.type === "capacity_retry") return { kind: "task", title: message2.reason ? `${message2.reason[0].toUpperCase()}${message2.reason.slice(1)}` : "Model at capacity", summary: `Retry ${message2.attempt} of ${message2.maxAttempts}`, content: "" };
17382
17382
  if (message2.type === "peer_message") return { kind: "task", title: `${message2.direction === "received" ? "Message from" : "Message to"} ${peerChatName(message2)}`, summary: "", content: message2.content };
17383
17383
  if (message2.type === "multitask_event") return { kind: "task", title: "Ship update", summary: message2.events.map((event) => `${event.agentName}: ${event.summary}`).join(" \xB7 "), content: "" };
17384
17384
  return { kind: "error", title: "Agent error", summary: "", content: message2.message };
@@ -18005,7 +18005,7 @@ function describeMessageSteps(message2, durationMs, background) {
18005
18005
  icon: "clock",
18006
18006
  live: "Retrying",
18007
18007
  done: "Retried",
18008
- target: { text: `(model at capacity, ${message2.attempt} of ${message2.maxAttempts})`, plain: true }
18008
+ target: { text: `(${message2.reason ?? "model at capacity"}, ${message2.attempt} of ${message2.maxAttempts})`, plain: true }
18009
18009
  }];
18010
18010
  default:
18011
18011
  return [];
@@ -19963,6 +19963,7 @@ var TaskAccumulator = class {
19963
19963
 
19964
19964
  // ../shared/src/display-message/parsers/replicas-parser.ts
19965
19965
  var HARNESS_EVENT_TYPE_PREFIX = "harness-";
19966
+ var HARNESS_RETRY_EVENT_TYPE = "harness-live-retry";
19966
19967
  function contentBlocks(value) {
19967
19968
  return Array.isArray(value) ? value.filter(isRecord) : [];
19968
19969
  }
@@ -19998,6 +19999,7 @@ function parseReplicasEvents(events) {
19998
19999
  const latestMs = (types) => Math.max(0, ...events.filter((event) => types.includes(event.type)).map((event) => Date.parse(event.timestamp)));
19999
20000
  const streamEndedMs = latestMs(["assistant_message", "error", "status"].map((type) => `${HARNESS_EVENT_TYPE_PREFIX}${type}`));
20000
20001
  const livePartialMs = latestMs([CLAUDE_PARTIAL_MESSAGE_EVENT_TYPE]);
20002
+ const retryMs = latestMs([HARNESS_RETRY_EVENT_TYPE]);
20001
20003
  events.forEach((event) => {
20002
20004
  const { payload, timestamp: timestamp2 } = event;
20003
20005
  const message2 = isRecord(payload.message) ? payload.message : {};
@@ -20075,9 +20077,23 @@ function parseReplicasEvents(events) {
20075
20077
  case `${HARNESS_EVENT_TYPE_PREFIX}error`:
20076
20078
  messages.push({ id: `replicas-error-${String(payload.seq)}`, type: "error", message: stringifyDisplayValue(payload.message) ?? "The agent stopped with an error", timestamp: timestamp2 });
20077
20079
  return;
20080
+ case HARNESS_RETRY_EVENT_TYPE: {
20081
+ const at = Date.parse(timestamp2);
20082
+ if (at < retryMs || at <= streamEndedMs || at < livePartialMs || typeof payload.attempt !== "number" || typeof payload.maxAttempts !== "number") return;
20083
+ messages.push({
20084
+ id: "replicas-retry",
20085
+ type: "capacity_retry",
20086
+ attempt: payload.attempt,
20087
+ maxAttempts: payload.maxAttempts,
20088
+ ...typeof payload.reason === "string" ? { reason: payload.reason } : {},
20089
+ status: "in_progress",
20090
+ timestamp: timestamp2
20091
+ });
20092
+ return;
20093
+ }
20078
20094
  case CLAUDE_PARTIAL_MESSAGE_EVENT_TYPE: {
20079
20095
  const partial = coerceClaudePartialMessagePayload(payload);
20080
- if (!partial || Date.parse(event.timestamp) <= streamEndedMs || Date.parse(event.timestamp) < livePartialMs) return;
20096
+ if (!partial || Date.parse(event.timestamp) <= Math.max(streamEndedMs, retryMs) || Date.parse(event.timestamp) < livePartialMs) return;
20081
20097
  if (partial.thinking) upsertDisplayMessage(messages, { id: `replicas-partial-${partial.streamId}-thinking`, type: "reasoning", content: partial.thinking, status: "in_progress", timestamp: timestamp2 });
20082
20098
  if (partial.text) upsertDisplayMessage(messages, { id: `replicas-partial-${partial.streamId}`, type: "agent", content: partial.text, timestamp: timestamp2 });
20083
20099
  return;
@@ -21702,7 +21718,7 @@ async function withRetry(label, fn, options) {
21702
21718
  }
21703
21719
 
21704
21720
  // ../shared/src/tensorlake.ts
21705
- var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-21-v5";
21721
+ var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-21-v7";
21706
21722
  var TENSORLAKE_DISK_MB = 100 * 1024;
21707
21723
 
21708
21724
  // ../shared/src/egress.ts
@@ -22360,7 +22376,8 @@ var harnessLiveMessageSchema = z34.union([
22360
22376
  z34.object({ type: z34.literal("delta"), streamId: z34.string(), thinking: z34.string() }),
22361
22377
  z34.object({ type: z34.literal("delta"), streamId: z34.string(), toolCall: z34.object({ id: z34.string(), name: z34.string(), argumentsDelta: z34.string() }) }),
22362
22378
  z34.object({ type: z34.literal("step_saved"), seq: z34.number() }),
22363
- z34.object({ type: z34.literal("status"), status: z34.enum(HARNESS_THREAD_STATUSES) })
22379
+ z34.object({ type: z34.literal("status"), status: z34.enum(HARNESS_THREAD_STATUSES) }),
22380
+ z34.object({ type: z34.literal("retry"), attempt: z34.number(), maxAttempts: z34.number(), reason: z34.string() })
22364
22381
  ]);
22365
22382
 
22366
22383
  // ../shared/src/harness/context.ts
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-7ZDAVYTV.js";
7
7
  import {
8
8
  AspClient
9
- } from "./chunk-2WZAPABZ.js";
9
+ } from "./chunk-SE7CCTGI.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-2GYFXGZB.js";
21
+ } from "./chunk-W5ZWLGYO.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-MV6KW27Y.js";
7
+ } from "./chunk-3OVJPBH7.js";
8
8
  import "./chunk-7ZDAVYTV.js";
9
- import "./chunk-D2AYEOGN.js";
9
+ import "./chunk-GHCYFXYP.js";
10
10
  import {
11
11
  isRecord
12
12
  } from "./chunk-UZSNFLDQ.js";
13
13
  import {
14
14
  rankToolsByQuery
15
- } from "./chunk-2GYFXGZB.js";
15
+ } from "./chunk-W5ZWLGYO.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-KY5V7DVX.js";
7
- import "./chunk-MQKLFCKW.js";
8
- import "./chunk-AHHPKYNJ.js";
6
+ } from "./chunk-CTRKO7C5.js";
7
+ import "./chunk-7DCGOTA6.js";
8
+ import "./chunk-74BNGRCS.js";
9
9
  import {
10
10
  isRecord
11
11
  } from "./chunk-UZSNFLDQ.js";
12
- import "./chunk-2GYFXGZB.js";
12
+ import "./chunk-W5ZWLGYO.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-7EHIWP34.js";
17
+ } from "./chunk-Z4POAFER.js";
18
18
  import "./chunk-7ZDAVYTV.js";
19
19
  import {
20
20
  AppServerProcess,
21
21
  buildCodexAgentEnv
22
- } from "./chunk-2WZAPABZ.js";
23
- import "./chunk-AHHPKYNJ.js";
22
+ } from "./chunk-SE7CCTGI.js";
23
+ import "./chunk-74BNGRCS.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-2GYFXGZB.js";
33
+ } from "./chunk-W5ZWLGYO.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-MV6KW27Y.js";
93
+ } from "./chunk-3OVJPBH7.js";
94
94
  import {
95
95
  evaluateCommandProtection,
96
96
  extractToolCommand,
97
97
  reportCommandProtectionBlock
98
- } from "./chunk-KY5V7DVX.js";
98
+ } from "./chunk-CTRKO7C5.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-7EHIWP34.js";
132
+ } from "./chunk-Z4POAFER.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-4DLTY4YV.js";
140
+ } from "./chunk-UDGB3ENL.js";
141
141
  import {
142
142
  ACCOUNT_RATE_LIMITS_READ_METHOD,
143
143
  AsyncLock,
@@ -215,12 +215,12 @@ import {
215
215
  transcriptSecrets,
216
216
  upsertCredentialFileLines,
217
217
  writeSecureCredentialFile
218
- } from "./chunk-CL6PB6PK.js";
218
+ } from "./chunk-O526LZXZ.js";
219
219
  import {
220
220
  SUBAGENT_MCP_TOOL_TIMEOUT_MS,
221
221
  engineScriptProcess,
222
222
  subagentMcpProcessConfig
223
- } from "./chunk-D2AYEOGN.js";
223
+ } from "./chunk-GHCYFXYP.js";
224
224
  import {
225
225
  ENGINE_ENV,
226
226
  UNQUOTED_PATHS_CONFIG,
@@ -231,18 +231,18 @@ import {
231
231
  resolveDiffBase,
232
232
  setAgentCredentialSnapshot,
233
233
  setLinearSessionId
234
- } from "./chunk-MQKLFCKW.js";
234
+ } from "./chunk-7DCGOTA6.js";
235
235
  import {
236
236
  AspRequestTimeoutError,
237
237
  AspResponseError,
238
238
  buildCodexAgentEnv,
239
239
  getCodexModelProvider
240
- } from "./chunk-2WZAPABZ.js";
240
+ } from "./chunk-SE7CCTGI.js";
241
241
  import {
242
242
  SUBPROCESS_MAX_BUFFER,
243
243
  execAsync,
244
244
  execFileAsync
245
- } from "./chunk-AHHPKYNJ.js";
245
+ } from "./chunk-74BNGRCS.js";
246
246
  import {
247
247
  isRecord
248
248
  } from "./chunk-UZSNFLDQ.js";
@@ -543,7 +543,7 @@ import {
543
543
  workspaceTokenRequestSchema,
544
544
  workspaceTokenResponseSchema,
545
545
  wrapInTag
546
- } from "./chunk-2GYFXGZB.js";
546
+ } from "./chunk-W5ZWLGYO.js";
547
547
  import {
548
548
  __commonJS,
549
549
  __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-4DLTY4YV.js";
6
+ } from "./chunk-UDGB3ENL.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-UZSNFLDQ.js";
10
10
  import {
11
11
  shouldRefreshPullRequests
12
- } from "./chunk-2GYFXGZB.js";
12
+ } from "./chunk-W5ZWLGYO.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-2GYFXGZB.js";
14
+ } from "./chunk-W5ZWLGYO.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.1707",
3
+ "version": "0.1.1709",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",