replicas-engine 0.1.745 → 0.1.746

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.
@@ -3,9 +3,9 @@ import {
3
3
  getCodexAspHost,
4
4
  restartCodexAspHost,
5
5
  restartCodexAspHostIfRunning
6
- } from "./chunk-IRO4TDFM.js";
6
+ } from "./chunk-OEW4EEUM.js";
7
7
  import "./chunk-ITEQAMIZ.js";
8
- import "./chunk-ZDBGX4MA.js";
8
+ import "./chunk-HNVRRGQU.js";
9
9
  import "./chunk-2RB7SIP3.js";
10
10
  import "./chunk-HMIVYASC.js";
11
11
  import "./chunk-5KSXSK7Y.js";
@@ -239,7 +239,7 @@ var DEFAULT_CODEX_ARGS = [
239
239
  var MIN_CODEX_CLI_VERSION = "0.153.3";
240
240
  var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
241
241
  var codexCliVersionEnsured = null;
242
- var ENGINE_PACKAGE_VERSION = "0.1.745";
242
+ var ENGINE_PACKAGE_VERSION = "0.1.746";
243
243
  var INITIALIZE_METHOD = "initialize";
244
244
  var INITIALIZED_NOTIFICATION = "initialized";
245
245
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  AppServerProcess,
9
9
  buildCodexAgentEnv
10
- } from "./chunk-ZDBGX4MA.js";
10
+ } from "./chunk-HNVRRGQU.js";
11
11
  import {
12
12
  CODEX_AUTH_ENV_KEYS,
13
13
  CODEX_AUTH_ENV_KEYS_BY_METHOD,
@@ -230,7 +230,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
230
230
  const data = await response.json();
231
231
  await this.applyCredentialsResponse(data);
232
232
  if (restartOnChange && CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index])) {
233
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-H2VMVKW2.js");
233
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-6HRB6NJ5.js");
234
234
  await restartCodexAspHostIfRunning2();
235
235
  }
236
236
  if (data.scope) {
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  AppServerProcess,
8
8
  buildCodexAgentEnv
9
- } from "./chunk-ZDBGX4MA.js";
9
+ } from "./chunk-HNVRRGQU.js";
10
10
  import {
11
11
  AGENT,
12
12
  getMemoryOutputSafetyViolation,
package/dist/src/index.js CHANGED
@@ -58,7 +58,7 @@ import {
58
58
  recordCredentialFallback,
59
59
  recordExhaustedCredential,
60
60
  restartCodexAspHost
61
- } from "./chunk-IRO4TDFM.js";
61
+ } from "./chunk-OEW4EEUM.js";
62
62
  import {
63
63
  ENGINE_ENV,
64
64
  IS_WARMING_MODE,
@@ -71,7 +71,7 @@ import {
71
71
  SUBPROCESS_MAX_BUFFER,
72
72
  execAsync,
73
73
  execFileAsync
74
- } from "./chunk-ZDBGX4MA.js";
74
+ } from "./chunk-HNVRRGQU.js";
75
75
  import {
76
76
  isRecord as isRecord2
77
77
  } from "./chunk-2RB7SIP3.js";
@@ -61276,11 +61276,16 @@ function parseChatMessageSendersJsonl(content) {
61276
61276
  }
61277
61277
 
61278
61278
  // src/services/upload-chat-transcripts.ts
61279
- var HISTORY_DIRS = [
61280
- join33(ENGINE_DIR2, "claude-histories"),
61281
- join33(ENGINE_DIR2, "relay-histories"),
61282
- join33(ENGINE_DIR2, "codex-histories")
61283
- ];
61279
+ var HISTORY_DIRS = [...new Set(Object.values(HISTORY_DIR_BY_PROVIDER))];
61280
+ var ALWAYS_UPLOAD_HISTORY_DIRS = /* @__PURE__ */ new Set([
61281
+ HISTORY_DIR_BY_PROVIDER.claude,
61282
+ HISTORY_DIR_BY_PROVIDER.codex,
61283
+ HISTORY_DIR_BY_PROVIDER.relay
61284
+ ]);
61285
+ function shouldFlushChatTranscript(historyDir, chat, chatsById) {
61286
+ const parent = chat?.parentChatId ? chatsById.get(chat.parentChatId) : void 0;
61287
+ return ALWAYS_UPLOAD_HISTORY_DIRS.has(historyDir) || parent?.provider === "relay";
61288
+ }
61284
61289
  async function flushAllChatTranscripts(chatsById = /* @__PURE__ */ new Map(), capture) {
61285
61290
  let flushed = 0;
61286
61291
  let failed = 0;
@@ -61296,8 +61301,10 @@ async function flushAllChatTranscripts(chatsById = /* @__PURE__ */ new Map(), ca
61296
61301
  for (const entry of entries) {
61297
61302
  if (!entry.endsWith(".jsonl")) continue;
61298
61303
  const chatId = basename3(entry, ".jsonl");
61304
+ const chat = chatsById.get(chatId);
61305
+ if (!shouldFlushChatTranscript(dir, chat, chatsById)) continue;
61299
61306
  tasks.push(
61300
- uploadChatTranscript(chatId, join33(dir, entry), chatsById.get(chatId), capture).then((artifact) => {
61307
+ uploadChatTranscript(chatId, join33(dir, entry), chat, capture).then((artifact) => {
61301
61308
  flushed++;
61302
61309
  if (artifact && capture) revisions.push(artifact);
61303
61310
  }).catch((err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.745",
3
+ "version": "0.1.746",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",