replicas-engine 0.1.946 → 0.1.947

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,9 +5,9 @@ import {
5
5
  getCodexAspHost,
6
6
  restartCodexAspHost,
7
7
  restartCodexAspHostIfRunning
8
- } from "./chunk-2CAFUVL2.js";
8
+ } from "./chunk-OOKACLKD.js";
9
9
  import "./chunk-ZZBMM76F.js";
10
- import "./chunk-LHP34AAB.js";
10
+ import "./chunk-L44X4ZET.js";
11
11
  import "./chunk-2QXVRD52.js";
12
12
  import "./chunk-UZSNFLDQ.js";
13
13
  import "./chunk-XCPVKR4M.js";
@@ -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.946";
243
+ var ENGINE_PACKAGE_VERSION = "0.1.947";
244
244
  var INITIALIZE_METHOD = "initialize";
245
245
  var INITIALIZED_NOTIFICATION = "initialized";
246
246
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  AppServerProcess,
11
11
  buildCodexAgentEnv
12
- } from "./chunk-LHP34AAB.js";
12
+ } from "./chunk-L44X4ZET.js";
13
13
  import {
14
14
  SUBPROCESS_MAX_BUFFER,
15
15
  execFileAsync
@@ -260,7 +260,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
260
260
  await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
261
261
  await this.applyCredentialsResponse(data);
262
262
  setAgentCredentialSnapshot("codex", data);
263
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-WKXFEW7U.js");
263
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-M4ME52W3.js");
264
264
  await restartCodexAspHostIfRunning2();
265
265
  });
266
266
  await this.start(true);
@@ -280,7 +280,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
280
280
  await this.applyCredentialUpdate(generation, async () => {
281
281
  await this.applyCredentialsResponse(data);
282
282
  if (restartOnChange && CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index])) {
283
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-WKXFEW7U.js");
283
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-M4ME52W3.js");
284
284
  await restartCodexAspHostIfRunning2();
285
285
  }
286
286
  setAgentCredentialSnapshot("codex", data);
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  AppServerProcess,
10
10
  buildCodexAgentEnv
11
- } from "./chunk-LHP34AAB.js";
11
+ } from "./chunk-L44X4ZET.js";
12
12
  import "./chunk-2QXVRD52.js";
13
13
  import {
14
14
  AGENT,
package/dist/src/index.js CHANGED
@@ -77,7 +77,7 @@ import {
77
77
  refreshDelayMs,
78
78
  restartCodexAspHost,
79
79
  routineRefreshExclusions
80
- } from "./chunk-2CAFUVL2.js";
80
+ } from "./chunk-OOKACLKD.js";
81
81
  import {
82
82
  ENGINE_ENV,
83
83
  monolithRequest,
@@ -89,7 +89,7 @@ import {
89
89
  import {
90
90
  AspClient,
91
91
  getCodexModelProvider
92
- } from "./chunk-LHP34AAB.js";
92
+ } from "./chunk-L44X4ZET.js";
93
93
  import {
94
94
  SUBPROCESS_MAX_BUFFER,
95
95
  execAsync,
@@ -60513,11 +60513,14 @@ function createForkInfo(source, trigger, startedAt, reason) {
60513
60513
  function isForkPreparing(chat) {
60514
60514
  return chat.persisted.fork?.state === "preparing";
60515
60515
  }
60516
+ function hasActiveBackgroundWork(chat) {
60517
+ return (chat.provider.hasActiveBackgroundTasks?.() ?? false) || isForkPreparing(chat);
60518
+ }
60516
60519
  function hasActiveAgentWork(chat) {
60517
- return chat.provider.isProcessing() || (chat.provider.hasActiveBackgroundTasks?.() ?? false) || isForkPreparing(chat);
60520
+ return chat.provider.isProcessing() || hasActiveBackgroundWork(chat);
60518
60521
  }
60519
60522
  function hasActiveChatTurn(chat) {
60520
- return chat.hasActiveTurn || chat.pendingMessageIds.length > 0 || hasActiveAgentWork(chat);
60523
+ return chat.hasActiveTurn || chat.pendingMessageIds.length > 0 || hasActiveBackgroundWork(chat) || (chat.settledProcessing ?? chat.provider.isProcessing());
60521
60524
  }
60522
60525
  function isPersistedChat(value) {
60523
60526
  if (!isRecord2(value)) {
@@ -61575,6 +61578,7 @@ var ChatService = class {
61575
61578
  hasActiveTurn: false,
61576
61579
  observedBranchesByRepo: /* @__PURE__ */ new Map(),
61577
61580
  lastTurnErrors: null,
61581
+ settledProcessing: null,
61578
61582
  errorNotificationTargets: /* @__PURE__ */ new Map(),
61579
61583
  activeErrorNotificationTargets: [],
61580
61584
  quotaExhaustion: null,
@@ -61621,6 +61625,7 @@ var ChatService = class {
61621
61625
  activateTurn(chat, messageId) {
61622
61626
  chat.hasActiveTurn = true;
61623
61627
  chat.activeMessageId = messageId;
61628
+ chat.settledProcessing = null;
61624
61629
  const context = this.agentChatActivityTrackerService.noteTurnStarted(
61625
61630
  chat.persisted.id,
61626
61631
  messageId,
@@ -61736,6 +61741,7 @@ var ChatService = class {
61736
61741
  handleProcessingStopped(chatId) {
61737
61742
  const chat = this.getRuntimeChat(chatId);
61738
61743
  if (!chat) return;
61744
+ chat.settledProcessing = null;
61739
61745
  this.publish({ type: "chat.updated", payload: { chat: this.toSummary(chat) } }).catch(() => {
61740
61746
  });
61741
61747
  this.notifyWorkspaceAgentIdle();
@@ -61771,6 +61777,7 @@ var ChatService = class {
61771
61777
  }
61772
61778
  }
61773
61779
  const stillProcessing = processing || forked;
61780
+ chat.settledProcessing = stillProcessing;
61774
61781
  this.publishTurnCompleted(chat, completedAt, stillProcessing);
61775
61782
  await this.publishAgentTurnCompleteWebhook(chat, completedAt, stillProcessing, forked ? null : exhaustion);
61776
61783
  this.notifyWorkspaceAgentIdle();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.946",
3
+ "version": "0.1.947",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",