replicas-engine 0.1.884 → 0.1.885

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,11 +5,11 @@ import {
5
5
  getCodexAspHost,
6
6
  restartCodexAspHost,
7
7
  restartCodexAspHostIfRunning
8
- } from "./chunk-DP3UK3OG.js";
9
- import "./chunk-TLTKYSY2.js";
10
- import "./chunk-LRCNGILZ.js";
8
+ } from "./chunk-YFCW367V.js";
9
+ import "./chunk-7TYRRODQ.js";
10
+ import "./chunk-VSSBRVE4.js";
11
11
  import "./chunk-UZSNFLDQ.js";
12
- import "./chunk-QIV55VSK.js";
12
+ import "./chunk-J46CEW2X.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
  export {
15
15
  getCodexAspHost,
@@ -3,12 +3,12 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  monolithRequest
6
- } from "./chunk-TLTKYSY2.js";
6
+ } from "./chunk-7TYRRODQ.js";
7
7
  import {
8
8
  extractCommandProtectionCommandText,
9
9
  findGitCommitSignals,
10
10
  findPrMergeSignals
11
- } from "./chunk-QIV55VSK.js";
11
+ } from "./chunk-J46CEW2X.js";
12
12
 
13
13
  // src/services/command-protection-service.ts
14
14
  var DEFAULT_COMMAND_PROTECTION_BLOCK_MESSAGE = "Blocked by Replicas command protection.";
@@ -15,7 +15,7 @@ import {
15
15
  isValidRelayBaseProvider,
16
16
  parsePosixEnvFile,
17
17
  readReplicasRuntimeEnv
18
- } from "./chunk-QIV55VSK.js";
18
+ } from "./chunk-J46CEW2X.js";
19
19
 
20
20
  // src/engine-env.ts
21
21
  import { readFileSync as readFileSync2 } 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
  shouldRefreshPullRequests
6
- } from "./chunk-QIV55VSK.js";
6
+ } from "./chunk-J46CEW2X.js";
7
7
 
8
8
  // src/services/post-tool-pr-notifier.ts
9
9
  async function notifyPostToolUse(toolName, toolInput) {
@@ -1122,6 +1122,9 @@ var MERGED_MESSAGE_SEPARATOR = "\n\n<!-- replicas:merged -->\n\n";
1122
1122
  var ENGINE_HEALTH_WAIT_HEADER = "X-Replicas-Health-Wait";
1123
1123
  var ENGINE_HEALTH_WAIT_QUERY_PARAM = "wait_ms";
1124
1124
  var ENGINE_HEALTH_MAX_WAIT_MS = 2e3;
1125
+ var updateChatDisplayNameRequestSchema = z3.object({
1126
+ displayName: z3.string().trim().min(1).max(100)
1127
+ });
1125
1128
  function getChatExecutionProvider(chat) {
1126
1129
  return chat.provider === "relay" ? chat.relayBaseProvider ?? DEFAULT_RELAY_BASE_PROVIDER : chat.provider;
1127
1130
  }
@@ -8165,6 +8168,7 @@ export {
8165
8168
  ENGINE_HEALTH_WAIT_HEADER,
8166
8169
  ENGINE_HEALTH_WAIT_QUERY_PARAM,
8167
8170
  ENGINE_HEALTH_MAX_WAIT_MS,
8171
+ updateChatDisplayNameRequestSchema,
8168
8172
  getChatExecutionProvider,
8169
8173
  createChatRequestSchema,
8170
8174
  spawnRelaySubagentRequestSchema,
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  HOOK_EXEC_MAX_BUFFER_BYTES,
6
6
  isVersionBelow
7
- } from "./chunk-QIV55VSK.js";
7
+ } from "./chunk-J46CEW2X.js";
8
8
 
9
9
  // src/utils/codex-agent-env.ts
10
10
  function buildCodexAgentEnv(source = process.env) {
@@ -245,7 +245,7 @@ function getCodexModelProvider(method) {
245
245
  if (method === "foundry") return "azure";
246
246
  return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
247
247
  }
248
- var ENGINE_PACKAGE_VERSION = "0.1.884";
248
+ var ENGINE_PACKAGE_VERSION = "0.1.885";
249
249
  var INITIALIZE_METHOD = "initialize";
250
250
  var INITIALIZED_NOTIFICATION = "initialized";
251
251
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -5,13 +5,13 @@ import {
5
5
  ENGINE_ENV,
6
6
  monolithRequest,
7
7
  setAgentCredentialSnapshot
8
- } from "./chunk-TLTKYSY2.js";
8
+ } from "./chunk-7TYRRODQ.js";
9
9
  import {
10
10
  AppServerProcess,
11
11
  SUBPROCESS_MAX_BUFFER,
12
12
  buildCodexAgentEnv,
13
13
  execFileAsync
14
- } from "./chunk-LRCNGILZ.js";
14
+ } from "./chunk-VSSBRVE4.js";
15
15
  import {
16
16
  isRecord
17
17
  } from "./chunk-UZSNFLDQ.js";
@@ -25,7 +25,7 @@ import {
25
25
  listOpenAICompatibleModels,
26
26
  readOllamaAuthEnv,
27
27
  resolveOpenAICompatibleModelsUrl
28
- } from "./chunk-QIV55VSK.js";
28
+ } from "./chunk-J46CEW2X.js";
29
29
 
30
30
  // src/managers/codex-token-manager.ts
31
31
  import { promises as fs } from "fs";
@@ -251,7 +251,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
251
251
  await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
252
252
  await this.applyCredentialsResponse(data);
253
253
  if (data.scope) setAgentCredentialSnapshot("codex", { method: data.type, scope: data.scope, revision: data.revision });
254
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-3HXYCUHC.js");
254
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-NWWLAIDG.js");
255
255
  await restartCodexAspHostIfRunning2();
256
256
  });
257
257
  await this.start(true);
@@ -271,7 +271,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
271
271
  await this.applyCredentialUpdate(generation, async () => {
272
272
  await this.applyCredentialsResponse(data);
273
273
  if (restartOnChange && CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index])) {
274
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-3HXYCUHC.js");
274
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-NWWLAIDG.js");
275
275
  await restartCodexAspHostIfRunning2();
276
276
  }
277
277
  if (data.scope) {
@@ -3,12 +3,12 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  evaluateCommandProtection
6
- } from "./chunk-EZOTWPOF.js";
7
- import "./chunk-TLTKYSY2.js";
6
+ } from "./chunk-6QSHMNX4.js";
7
+ import "./chunk-7TYRRODQ.js";
8
8
  import {
9
9
  isRecord
10
10
  } from "./chunk-UZSNFLDQ.js";
11
- import "./chunk-QIV55VSK.js";
11
+ import "./chunk-J46CEW2X.js";
12
12
  import "./chunk-VEQXQN22.js";
13
13
 
14
14
  // src/command-protection-hook.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-EZOTWPOF.js";
6
+ } from "./chunk-6QSHMNX4.js";
7
7
  import {
8
8
  notifyPostToolUse
9
- } from "./chunk-4W3WM2X7.js";
10
- import "./chunk-TLTKYSY2.js";
9
+ } from "./chunk-AN4CDU34.js";
10
+ import "./chunk-7TYRRODQ.js";
11
11
  import "./chunk-UZSNFLDQ.js";
12
- import "./chunk-QIV55VSK.js";
12
+ import "./chunk-J46CEW2X.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/deepseek-command-protection-plugin.ts
@@ -8,12 +8,12 @@ import {
8
8
  import {
9
9
  AppServerProcess,
10
10
  buildCodexAgentEnv
11
- } from "./chunk-LRCNGILZ.js";
11
+ } from "./chunk-VSSBRVE4.js";
12
12
  import {
13
13
  AGENT,
14
14
  getMemoryOutputSafetyViolation,
15
15
  headlessAgentRequestSchema
16
- } from "./chunk-QIV55VSK.js";
16
+ } from "./chunk-J46CEW2X.js";
17
17
  import "./chunk-VEQXQN22.js";
18
18
 
19
19
  // src/headless-agent.ts
package/dist/src/index.js CHANGED
@@ -91,7 +91,7 @@ import {
91
91
  evaluateCommandProtection,
92
92
  extractToolCommand,
93
93
  reportCommandProtectionBlock
94
- } from "./chunk-EZOTWPOF.js";
94
+ } from "./chunk-6QSHMNX4.js";
95
95
  import {
96
96
  ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
97
97
  AGENT_MESSAGE_DELTA_METHOD,
@@ -133,21 +133,21 @@ import {
133
133
  recordExhaustedCredential,
134
134
  restartCodexAspHost,
135
135
  routineRefreshExclusions
136
- } from "./chunk-DP3UK3OG.js";
136
+ } from "./chunk-YFCW367V.js";
137
137
  import {
138
138
  ENGINE_ENV,
139
139
  IS_WARMING_MODE,
140
140
  monolithRequest,
141
141
  monolithService,
142
142
  setAgentCredentialSnapshot
143
- } from "./chunk-TLTKYSY2.js";
143
+ } from "./chunk-7TYRRODQ.js";
144
144
  import {
145
145
  AspClient,
146
146
  SUBPROCESS_MAX_BUFFER,
147
147
  execAsync,
148
148
  execFileAsync,
149
149
  getCodexModelProvider
150
- } from "./chunk-LRCNGILZ.js";
150
+ } from "./chunk-VSSBRVE4.js";
151
151
  import {
152
152
  isRecord as isRecord2
153
153
  } from "./chunk-UZSNFLDQ.js";
@@ -359,10 +359,11 @@ import {
359
359
  shouldRefreshPullRequests,
360
360
  spawnRelaySubagentRequestSchema,
361
361
  stripAgentDiagnosticErrors,
362
+ updateChatDisplayNameRequestSchema,
362
363
  waitRelaySubagentRequestSchema,
363
364
  withTimeout,
364
365
  workspaceCredentialProviderSchema
365
- } from "./chunk-QIV55VSK.js";
366
+ } from "./chunk-J46CEW2X.js";
366
367
  import {
367
368
  __commonJS,
368
369
  __export,
@@ -61297,7 +61298,7 @@ function isPersistedChat(value) {
61297
61298
  return false;
61298
61299
  }
61299
61300
  const candidate = value;
61300
- return typeof candidate.id === "string" && typeof candidate.provider === "string" && isValidAgentProvider(candidate.provider) && (candidate.relayBaseProvider === void 0 || candidate.provider === "relay" && typeof candidate.relayBaseProvider === "string" && isValidCodingAgentProvider(candidate.relayBaseProvider)) && typeof candidate.title === "string" && typeof candidate.createdAt === "string" && typeof candidate.updatedAt === "string" && (candidate.providerSessionId === null || typeof candidate.providerSessionId === "string") && (candidate.parentChatId === void 0 || candidate.parentChatId === null || typeof candidate.parentChatId === "string") && (candidate.deletedAt === void 0 || candidate.deletedAt === null || typeof candidate.deletedAt === "string");
61301
+ return typeof candidate.id === "string" && typeof candidate.provider === "string" && isValidAgentProvider(candidate.provider) && (candidate.relayBaseProvider === void 0 || candidate.provider === "relay" && typeof candidate.relayBaseProvider === "string" && isValidCodingAgentProvider(candidate.relayBaseProvider)) && typeof candidate.title === "string" && (candidate.displayName === void 0 || typeof candidate.displayName === "string") && typeof candidate.createdAt === "string" && typeof candidate.updatedAt === "string" && (candidate.providerSessionId === null || typeof candidate.providerSessionId === "string") && (candidate.parentChatId === void 0 || candidate.parentChatId === null || typeof candidate.parentChatId === "string") && (candidate.deletedAt === void 0 || candidate.deletedAt === null || typeof candidate.deletedAt === "string");
61301
61302
  }
61302
61303
  function normalizePersistedChat(chat) {
61303
61304
  const isLegacyCodexSdkChat = chat.provider === "codex" && (chat.codexBackend === "sdk" || chat.codexBackend === void 0 && chat.providerSessionId !== null);
@@ -61307,6 +61308,7 @@ function normalizePersistedChat(chat) {
61307
61308
  ...typeof chat.model === "string" && chat.model ? { model: chat.model } : {},
61308
61309
  ...chat.provider === "relay" ? { relayBaseProvider: getChatExecutionProvider(chat) } : {},
61309
61310
  title: chat.title,
61311
+ ...chat.displayName ? { displayName: chat.displayName } : {},
61310
61312
  createdAt: chat.createdAt,
61311
61313
  updatedAt: chat.updatedAt,
61312
61314
  providerSessionId: isLegacyCodexSdkChat ? null : chat.providerSessionId,
@@ -61756,6 +61758,20 @@ var ChatService = class {
61756
61758
  });
61757
61759
  return { goal };
61758
61760
  }
61761
+ async updateDisplayName(chatId, displayName) {
61762
+ const chat = this.requireChat(chatId);
61763
+ const previousDisplayName = chat.persisted.displayName;
61764
+ chat.persisted.displayName = displayName;
61765
+ try {
61766
+ await this.persistAllChats();
61767
+ } catch (error) {
61768
+ chat.persisted.displayName = previousDisplayName;
61769
+ throw error;
61770
+ }
61771
+ const summary = this.toSummary(chat);
61772
+ await this.publish({ type: "chat.updated", payload: { chat: summary } });
61773
+ return summary;
61774
+ }
61759
61775
  getChatQueue(chatId) {
61760
61776
  const chat = this.requireChat(chatId);
61761
61777
  return {
@@ -62299,6 +62315,7 @@ var ChatService = class {
62299
62315
  model: chat.persisted.model,
62300
62316
  ...chat.persisted.provider === "relay" ? { relayBaseProvider: getChatExecutionProvider(chat.persisted) } : {},
62301
62317
  title: chat.persisted.title,
62318
+ displayName: chat.persisted.displayName,
62302
62319
  createdAt: chat.persisted.createdAt,
62303
62320
  updatedAt: chat.persisted.updatedAt,
62304
62321
  historyVersion: !hasActiveChatTurn(chat) && chat.acceptingMessages === 0 ? chat.historyVersion : void 0,
@@ -63898,6 +63915,21 @@ function createV1Routes(deps) {
63898
63915
  const response = { chat };
63899
63916
  return c.json(response);
63900
63917
  });
63918
+ app2.patch("/chats/:chatId", async (c) => {
63919
+ try {
63920
+ const body = updateChatDisplayNameRequestSchema.parse(await c.req.json());
63921
+ const chat = await deps.chatService.updateDisplayName(c.req.param("chatId"), body.displayName);
63922
+ return c.json({ chat });
63923
+ } catch (error) {
63924
+ if (error instanceof z6.ZodError) {
63925
+ return c.json(jsonError(error.issues[0]?.message || "Invalid tab name"), 400);
63926
+ }
63927
+ if (error instanceof ChatNotFoundError) {
63928
+ return c.json(jsonError("Failed to rename tab", error.message), 404);
63929
+ }
63930
+ return c.json(jsonError("Failed to rename tab", error instanceof Error ? error.message : "Unknown error"), 500);
63931
+ }
63932
+ });
63901
63933
  app2.delete("/chats/:chatId", async (c) => {
63902
63934
  const chatId = c.req.param("chatId");
63903
63935
  try {
@@ -3,11 +3,11 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  notifyPostToolUse
6
- } from "./chunk-4W3WM2X7.js";
6
+ } from "./chunk-AN4CDU34.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-UZSNFLDQ.js";
10
- import "./chunk-QIV55VSK.js";
10
+ import "./chunk-J46CEW2X.js";
11
11
  import "./chunk-VEQXQN22.js";
12
12
 
13
13
  // src/post-tool-pr-hook.ts
@@ -11,7 +11,7 @@ import {
11
11
  relaySubagentResponseSchema,
12
12
  spawnRelaySubagentRequestSchema,
13
13
  waitRelaySubagentRequestSchema
14
- } from "./chunk-QIV55VSK.js";
14
+ } from "./chunk-J46CEW2X.js";
15
15
  import "./chunk-VEQXQN22.js";
16
16
 
17
17
  // src/relay-mcp.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.884",
3
+ "version": "0.1.885",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",