replicas-engine 0.1.611 → 0.1.612

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.
Files changed (2) hide show
  1. package/dist/src/index.js +24 -24
  2. package/package.json +1 -1
package/dist/src/index.js CHANGED
@@ -7686,13 +7686,13 @@ import { mkdir as mkdir7 } from "fs/promises";
7686
7686
  import { homedir as homedir9 } from "os";
7687
7687
  import { join as join12 } from "path";
7688
7688
  import { randomUUID } from "crypto";
7689
- var ENGINE_DIR2 = join12(homedir9(), ".replicas", "engine");
7690
- var EVENTS_FILE = join12(ENGINE_DIR2, "events.jsonl");
7689
+ var ENGINE_DIR = join12(homedir9(), ".replicas", "engine");
7690
+ var EVENTS_FILE = join12(ENGINE_DIR, "events.jsonl");
7691
7691
  var EventService = class {
7692
7692
  subscribers = /* @__PURE__ */ new Map();
7693
7693
  writer = new StreamWriter();
7694
7694
  async initialize() {
7695
- await mkdir7(ENGINE_DIR2, { recursive: true });
7695
+ await mkdir7(ENGINE_DIR, { recursive: true });
7696
7696
  this.writer.open(EVENTS_FILE);
7697
7697
  }
7698
7698
  subscribe(subscriber) {
@@ -10868,7 +10868,7 @@ var DEFAULT_CODEX_ARGS = ["app-server", "--listen", "stdio://"];
10868
10868
  var MIN_CODEX_CLI_VERSION = "0.144.6";
10869
10869
  var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
10870
10870
  var codexCliVersionEnsured = null;
10871
- var ENGINE_PACKAGE_VERSION = "0.1.611";
10871
+ var ENGINE_PACKAGE_VERSION = "0.1.612";
10872
10872
  var INITIALIZE_METHOD = "initialize";
10873
10873
  var INITIALIZED_NOTIFICATION = "initialized";
10874
10874
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -11797,14 +11797,14 @@ var TranscriptUpdateCoalescer = class {
11797
11797
  // src/services/chat/history-paths.ts
11798
11798
  import { homedir as homedir13 } from "os";
11799
11799
  import { join as join17 } from "path";
11800
- var ENGINE_DIR3 = join17(homedir13(), ".replicas", "engine");
11801
- var CHATS_FILE = join17(ENGINE_DIR3, "chats.json");
11802
- var CLAUDE_HISTORY_DIR = join17(ENGINE_DIR3, "claude-histories");
11803
- var RELAY_HISTORY_DIR = join17(ENGINE_DIR3, "relay-histories");
11804
- var CODEX_HISTORY_DIR = join17(ENGINE_DIR3, "codex-histories");
11805
- var CURSOR_HISTORY_DIR = join17(ENGINE_DIR3, "cursor-histories");
11806
- var OPENCODE_HISTORY_DIR = join17(ENGINE_DIR3, "opencode-histories");
11807
- var PI_HISTORY_DIR = join17(ENGINE_DIR3, "pi-histories");
11800
+ var ENGINE_DIR2 = join17(homedir13(), ".replicas", "engine");
11801
+ var CHATS_FILE = join17(ENGINE_DIR2, "chats.json");
11802
+ var CLAUDE_HISTORY_DIR = join17(ENGINE_DIR2, "claude-histories");
11803
+ var RELAY_HISTORY_DIR = join17(ENGINE_DIR2, "relay-histories");
11804
+ var CODEX_HISTORY_DIR = join17(ENGINE_DIR2, "codex-histories");
11805
+ var CURSOR_HISTORY_DIR = join17(ENGINE_DIR2, "cursor-histories");
11806
+ var OPENCODE_HISTORY_DIR = join17(ENGINE_DIR2, "opencode-histories");
11807
+ var PI_HISTORY_DIR = join17(ENGINE_DIR2, "pi-histories");
11808
11808
  var HISTORY_DIR_BY_PROVIDER = {
11809
11809
  claude: CLAUDE_HISTORY_DIR,
11810
11810
  relay: RELAY_HISTORY_DIR,
@@ -15248,7 +15248,7 @@ var AgentChatActivityBuffer = class {
15248
15248
  options.storageName,
15249
15249
  ...options.legacyStorageNames ?? []
15250
15250
  ];
15251
- this.liveFile = join22(ENGINE_DIR, `${options.storageName}.jsonl`);
15251
+ this.liveFile = join22(ENGINE_DIR2, `${options.storageName}.jsonl`);
15252
15252
  this.segmentFilePatterns = this.storageNames.map(
15253
15253
  (storageName) => new RegExp(`^${storageName}\\.(\\d+)\\.jsonl$`)
15254
15254
  );
@@ -15265,7 +15265,7 @@ var AgentChatActivityBuffer = class {
15265
15265
  failed: 0
15266
15266
  });
15267
15267
  append(record) {
15268
- const pending = mkdir14(ENGINE_DIR, { recursive: true }).then(
15268
+ const pending = mkdir14(ENGINE_DIR2, { recursive: true }).then(
15269
15269
  () => appendFile3(this.liveFile, `${JSON.stringify(record)}
15270
15270
  `, "utf-8")
15271
15271
  ).catch((error) => {
@@ -15307,19 +15307,19 @@ var AgentChatActivityBuffer = class {
15307
15307
  await Promise.allSettled([...this.pendingAppends]);
15308
15308
  for (const storageName of this.storageNames) {
15309
15309
  await rename2(
15310
- join22(ENGINE_DIR, `${storageName}.jsonl`),
15311
- join22(ENGINE_DIR, `${storageName}.${Date.now()}.jsonl`)
15310
+ join22(ENGINE_DIR2, `${storageName}.jsonl`),
15311
+ join22(ENGINE_DIR2, `${storageName}.${Date.now()}.jsonl`)
15312
15312
  ).catch(() => {
15313
15313
  });
15314
15314
  }
15315
- const entries = await readdir6(ENGINE_DIR).catch(() => []);
15315
+ const entries = await readdir6(ENGINE_DIR2).catch(() => []);
15316
15316
  let flushed = 0;
15317
15317
  let failed = 0;
15318
15318
  for (const entry of entries) {
15319
15319
  if (!this.segmentFilePatterns.some((pattern) => pattern.test(entry)))
15320
15320
  continue;
15321
15321
  try {
15322
- await this.uploadSegment(join22(ENGINE_DIR, entry));
15322
+ await this.uploadSegment(join22(ENGINE_DIR2, entry));
15323
15323
  flushed++;
15324
15324
  } catch (error) {
15325
15325
  failed++;
@@ -15351,7 +15351,7 @@ var AgentChatActivityBuffer = class {
15351
15351
  ) && entry.endsWith(UPLOADED_SUFFIX)
15352
15352
  ).sort();
15353
15353
  for (const entry of uploaded.slice(0, -MAX_UPLOADED_SEGMENTS)) {
15354
- await unlink3(join22(ENGINE_DIR, entry)).catch(() => {
15354
+ await unlink3(join22(ENGINE_DIR2, entry)).catch(() => {
15355
15355
  });
15356
15356
  }
15357
15357
  return { flushed, failed };
@@ -15820,7 +15820,7 @@ import { basename as basename2, join as join25 } from "path";
15820
15820
 
15821
15821
  // src/services/chat/chat-senders.ts
15822
15822
  import { join as join24 } from "path";
15823
- var CHAT_SENDERS_DIR = join24(ENGINE_DIR3, "chat-senders");
15823
+ var CHAT_SENDERS_DIR = join24(ENGINE_DIR2, "chat-senders");
15824
15824
  function chatMessageSendersFilePath(chatId) {
15825
15825
  return join24(CHAT_SENDERS_DIR, `${chatId}.jsonl`);
15826
15826
  }
@@ -15838,9 +15838,9 @@ function parseChatMessageSendersJsonl(content) {
15838
15838
 
15839
15839
  // src/services/upload-chat-transcripts.ts
15840
15840
  var HISTORY_DIRS = [
15841
- join25(ENGINE_DIR3, "claude-histories"),
15842
- join25(ENGINE_DIR3, "relay-histories"),
15843
- join25(ENGINE_DIR3, "codex-histories")
15841
+ join25(ENGINE_DIR2, "claude-histories"),
15842
+ join25(ENGINE_DIR2, "relay-histories"),
15843
+ join25(ENGINE_DIR2, "codex-histories")
15844
15844
  ];
15845
15845
  async function putTranscript(uploadUrl, filePath, size) {
15846
15846
  await new Promise((resolve5, reject) => {
@@ -16224,7 +16224,7 @@ var ChatService = class {
16224
16224
  persistInFlight = false;
16225
16225
  persistQueued = false;
16226
16226
  async initialize() {
16227
- await mkdir15(ENGINE_DIR3, { recursive: true });
16227
+ await mkdir15(ENGINE_DIR2, { recursive: true });
16228
16228
  await mkdir15(CLAUDE_HISTORY_DIR, { recursive: true });
16229
16229
  await mkdir15(RELAY_HISTORY_DIR, { recursive: true });
16230
16230
  await mkdir15(CODEX_HISTORY_DIR, { recursive: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.611",
3
+ "version": "0.1.612",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",