replicas-engine 0.1.965 → 0.1.967

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,12 +5,12 @@ import {
5
5
  getCodexAspHost,
6
6
  restartCodexAspHost,
7
7
  restartCodexAspHostIfRunning
8
- } from "./chunk-MEVE5U5A.js";
9
- import "./chunk-ACUYRC4H.js";
10
- import "./chunk-AOF42AV2.js";
11
- import "./chunk-TP5NFRFE.js";
8
+ } from "./chunk-YIKQKQQI.js";
9
+ import "./chunk-JH2UMGOT.js";
10
+ import "./chunk-DMGFNUGG.js";
11
+ import "./chunk-EUMRQH4J.js";
12
12
  import "./chunk-UZSNFLDQ.js";
13
- import "./chunk-BYJ6CIME.js";
13
+ import "./chunk-4KMPRAV6.js";
14
14
  import "./chunk-VEQXQN22.js";
15
15
  export {
16
16
  getCodexAspHost,
@@ -265,6 +265,31 @@ function normalizeClaudeModel(model) {
265
265
  }
266
266
  return model;
267
267
  }
268
+ function toClaudeCodeModel(model, bedrock) {
269
+ if (!bedrock) {
270
+ return model;
271
+ }
272
+ switch (normalizeClaudeModel(model)) {
273
+ case CLAUDE_FABLE_5_1_MODEL:
274
+ return CLAUDE_FABLE_5_1_BEDROCK_MODEL;
275
+ case CLAUDE_FABLE_5_MODEL:
276
+ return CLAUDE_FABLE_5_BEDROCK_MODEL;
277
+ case CLAUDE_OPUS_5_5_MODEL:
278
+ return CLAUDE_OPUS_5_5_BEDROCK_MODEL;
279
+ case CLAUDE_OPUS_5_MODEL:
280
+ return CLAUDE_OPUS_5_BEDROCK_MODEL;
281
+ case CLAUDE_OPUS_4_8_MODEL:
282
+ return "opus";
283
+ case CLAUDE_SONNET_5_5_MODEL:
284
+ return CLAUDE_SONNET_5_5_BEDROCK_MODEL;
285
+ case CLAUDE_SONNET_5_MODEL:
286
+ return "sonnet";
287
+ case CLAUDE_HAIKU_4_5_MODEL:
288
+ return "haiku";
289
+ default:
290
+ return model;
291
+ }
292
+ }
268
293
  var CLAUDE_MODEL_CONTEXT_WINDOWS = {
269
294
  [CLAUDE_FABLE_5_1_MODEL]: 1e6,
270
295
  [CLAUDE_FABLE_5_MODEL]: 1e6,
@@ -8742,6 +8767,8 @@ function normalizeChatTranscriptMetadata(value) {
8742
8767
  provider,
8743
8768
  relayBaseProvider,
8744
8769
  credential,
8770
+ credentialSource,
8771
+ model,
8745
8772
  title,
8746
8773
  displayName,
8747
8774
  createdAt,
@@ -8760,6 +8787,8 @@ function normalizeChatTranscriptMetadata(value) {
8760
8787
  if (normalizedProvider) metadata.provider = normalizedProvider;
8761
8788
  const parsedCredential = agentCredentialSnapshotSchema.safeParse(credential);
8762
8789
  if (parsedCredential.success) metadata.credential = parsedCredential.data;
8790
+ if (credentialSource === "stored" || credentialSource === "environment") metadata.credentialSource = credentialSource;
8791
+ if (typeof model === "string") metadata.model = model;
8763
8792
  if (typeof title === "string") metadata.title = title;
8764
8793
  if (typeof displayName === "string") metadata.displayName = displayName;
8765
8794
  if (typeof createdAt === "string") metadata.createdAt = createdAt;
@@ -8870,20 +8899,7 @@ export {
8870
8899
  fetchOpenCodeGoCatalog,
8871
8900
  DEFAULT_CHAT_TITLES,
8872
8901
  isDefaultChat,
8873
- CLAUDE_FABLE_5_1_MODEL,
8874
- CLAUDE_FABLE_5_MODEL,
8875
- CLAUDE_OPUS_5_5_MODEL,
8876
- CLAUDE_OPUS_5_MODEL,
8877
- CLAUDE_OPUS_4_8_MODEL,
8878
- CLAUDE_SONNET_5_5_MODEL,
8879
- CLAUDE_SONNET_5_MODEL,
8880
- CLAUDE_HAIKU_4_5_MODEL,
8881
- CLAUDE_FABLE_5_1_BEDROCK_MODEL,
8882
- CLAUDE_FABLE_5_BEDROCK_MODEL,
8883
- CLAUDE_OPUS_5_5_BEDROCK_MODEL,
8884
- CLAUDE_OPUS_5_BEDROCK_MODEL,
8885
8902
  CLAUDE_OPUS_4_8_BEDROCK_MODEL,
8886
- CLAUDE_SONNET_5_5_BEDROCK_MODEL,
8887
8903
  CLAUDE_SONNET_5_BEDROCK_MODEL,
8888
8904
  CLAUDE_HAIKU_4_5_BEDROCK_MODEL,
8889
8905
  DEFAULT_CLAUDE_MODEL,
@@ -8894,6 +8910,7 @@ export {
8894
8910
  DEFAULT_PI_MODEL,
8895
8911
  getDefaultAgentModel,
8896
8912
  normalizeClaudeModel,
8913
+ toClaudeCodeModel,
8897
8914
  getClaudeModelContextWindow,
8898
8915
  canUseClaudeFastMode,
8899
8916
  AGENT_MODELS,
@@ -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-TP5NFRFE.js";
6
+ } from "./chunk-EUMRQH4J.js";
7
7
  import {
8
8
  isVersionBelow
9
- } from "./chunk-BYJ6CIME.js";
9
+ } from "./chunk-4KMPRAV6.js";
10
10
 
11
11
  // src/utils/codex-agent-env.ts
12
12
  function buildCodexAgentEnv(source = process.env) {
@@ -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.965";
243
+ var ENGINE_PACKAGE_VERSION = "0.1.967";
244
244
  var INITIALIZE_METHOD = "initialize";
245
245
  var INITIALIZED_NOTIFICATION = "initialized";
246
246
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -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-BYJ6CIME.js";
6
+ } from "./chunk-4KMPRAV6.js";
7
7
 
8
8
  // src/utils/exec.ts
9
9
  import { exec, execFile } from "child_process";
@@ -14,7 +14,7 @@ import {
14
14
  isValidAgentProvider,
15
15
  parsePosixEnvFile,
16
16
  readReplicasRuntimeEnv
17
- } from "./chunk-BYJ6CIME.js";
17
+ } from "./chunk-4KMPRAV6.js";
18
18
 
19
19
  // src/runtime-env-loader.ts
20
20
  import { readFileSync } from "fs";
@@ -5,7 +5,7 @@ import {
5
5
  extractCommandProtectionCommandText,
6
6
  isRecord,
7
7
  parseCodeHostPrUrl
8
- } from "./chunk-BYJ6CIME.js";
8
+ } from "./chunk-4KMPRAV6.js";
9
9
 
10
10
  // src/services/published-pull-request-urls.ts
11
11
  function publishedPullRequestUrls(result) {
@@ -5,15 +5,15 @@ import {
5
5
  ENGINE_ENV,
6
6
  monolithRequest,
7
7
  setAgentCredentialSnapshot
8
- } from "./chunk-ACUYRC4H.js";
8
+ } from "./chunk-JH2UMGOT.js";
9
9
  import {
10
10
  AppServerProcess,
11
11
  buildCodexAgentEnv
12
- } from "./chunk-AOF42AV2.js";
12
+ } from "./chunk-DMGFNUGG.js";
13
13
  import {
14
14
  SUBPROCESS_MAX_BUFFER,
15
15
  execFileAsync
16
- } from "./chunk-TP5NFRFE.js";
16
+ } from "./chunk-EUMRQH4J.js";
17
17
  import {
18
18
  isRecord
19
19
  } from "./chunk-UZSNFLDQ.js";
@@ -27,7 +27,7 @@ import {
27
27
  listOpenAICompatibleModels,
28
28
  readOllamaAuthEnv,
29
29
  resolveOpenAICompatibleModelsUrl
30
- } from "./chunk-BYJ6CIME.js";
30
+ } from "./chunk-4KMPRAV6.js";
31
31
 
32
32
  // src/managers/codex-token-manager.ts
33
33
  import { promises as fs } from "fs";
@@ -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-6ZAFHJHO.js");
263
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-JUJJHJWJ.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-6ZAFHJHO.js");
283
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-JUJJHJWJ.js");
284
284
  await restartCodexAspHostIfRunning2();
285
285
  }
286
286
  setAgentCredentialSnapshot("codex", data);
@@ -3,18 +3,18 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  monolithRequest
6
- } from "./chunk-ACUYRC4H.js";
6
+ } from "./chunk-JH2UMGOT.js";
7
7
  import {
8
8
  SUBPROCESS_MAX_BUFFER,
9
9
  execFileAsync
10
- } from "./chunk-TP5NFRFE.js";
10
+ } from "./chunk-EUMRQH4J.js";
11
11
  import {
12
12
  extractCommandProtectionCommandText,
13
13
  findCommandProtectionGitLookups,
14
14
  findGitCommitSignals,
15
15
  findPrMergeSignals,
16
16
  parseCommandProtectionRequest
17
- } from "./chunk-BYJ6CIME.js";
17
+ } from "./chunk-4KMPRAV6.js";
18
18
 
19
19
  // src/services/command-protection-service.ts
20
20
  import { readFile, stat } from "fs/promises";
@@ -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-SLRHEFTS.js";
7
- import "./chunk-ACUYRC4H.js";
8
- import "./chunk-TP5NFRFE.js";
6
+ } from "./chunk-ZRCBGXER.js";
7
+ import "./chunk-JH2UMGOT.js";
8
+ import "./chunk-EUMRQH4J.js";
9
9
  import {
10
10
  isRecord
11
11
  } from "./chunk-UZSNFLDQ.js";
12
- import "./chunk-BYJ6CIME.js";
12
+ import "./chunk-4KMPRAV6.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/command-protection-hook.ts
@@ -7,12 +7,12 @@ import {
7
7
  import {
8
8
  AppServerProcess,
9
9
  buildCodexAgentEnv
10
- } from "./chunk-AOF42AV2.js";
11
- import "./chunk-TP5NFRFE.js";
10
+ } from "./chunk-DMGFNUGG.js";
11
+ import "./chunk-EUMRQH4J.js";
12
12
  import {
13
13
  AGENT,
14
14
  headlessAgentRequestSchema
15
- } from "./chunk-BYJ6CIME.js";
15
+ } from "./chunk-4KMPRAV6.js";
16
16
  import "./chunk-VEQXQN22.js";
17
17
 
18
18
  // src/headless-agent.ts
package/dist/src/index.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  reportCommandProtectionBlock,
33
33
  resolveDiffBase,
34
34
  runGitCommand
35
- } from "./chunk-SLRHEFTS.js";
35
+ } from "./chunk-ZRCBGXER.js";
36
36
  import {
37
37
  ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
38
38
  AGENT_MESSAGE_DELTA_METHOD,
@@ -56,7 +56,7 @@ import {
56
56
  } from "./chunk-UPCC4BX5.js";
57
57
  import {
58
58
  publishedPullRequestUrls
59
- } from "./chunk-YDKFWJY7.js";
59
+ } from "./chunk-MHGSYSA2.js";
60
60
  import {
61
61
  BaseRefreshManager,
62
62
  CodexAspAuthMethodChangedError,
@@ -71,7 +71,7 @@ import {
71
71
  refreshDelayMs,
72
72
  restartCodexAspHost,
73
73
  routineRefreshExclusions
74
- } from "./chunk-MEVE5U5A.js";
74
+ } from "./chunk-YIKQKQQI.js";
75
75
  import {
76
76
  ENGINE_ENV,
77
77
  monolithRequest,
@@ -79,16 +79,16 @@ import {
79
79
  readRuntimeEnvFile,
80
80
  reloadEngineEnv,
81
81
  setAgentCredentialSnapshot
82
- } from "./chunk-ACUYRC4H.js";
82
+ } from "./chunk-JH2UMGOT.js";
83
83
  import {
84
84
  AspClient,
85
85
  getCodexModelProvider
86
- } from "./chunk-AOF42AV2.js";
86
+ } from "./chunk-DMGFNUGG.js";
87
87
  import {
88
88
  SUBPROCESS_MAX_BUFFER,
89
89
  execAsync,
90
90
  execFileAsync
91
- } from "./chunk-TP5NFRFE.js";
91
+ } from "./chunk-EUMRQH4J.js";
92
92
  import {
93
93
  isRecord as isRecord2
94
94
  } from "./chunk-UZSNFLDQ.js";
@@ -110,23 +110,10 @@ import {
110
110
  CHAT_INTERRUPTED_EVENT_TYPE,
111
111
  CLAUDE_AUTH_ENV_KEYS,
112
112
  CLAUDE_AUTH_ENV_KEYS_BY_METHOD,
113
- CLAUDE_FABLE_5_1_BEDROCK_MODEL,
114
- CLAUDE_FABLE_5_1_MODEL,
115
- CLAUDE_FABLE_5_BEDROCK_MODEL,
116
- CLAUDE_FABLE_5_MODEL,
117
113
  CLAUDE_HAIKU_4_5_BEDROCK_MODEL,
118
- CLAUDE_HAIKU_4_5_MODEL,
119
114
  CLAUDE_OPUS_4_8_BEDROCK_MODEL,
120
- CLAUDE_OPUS_4_8_MODEL,
121
- CLAUDE_OPUS_5_5_BEDROCK_MODEL,
122
- CLAUDE_OPUS_5_5_MODEL,
123
- CLAUDE_OPUS_5_BEDROCK_MODEL,
124
- CLAUDE_OPUS_5_MODEL,
125
115
  CLAUDE_PARTIAL_MESSAGE_EVENT_TYPE,
126
- CLAUDE_SONNET_5_5_BEDROCK_MODEL,
127
- CLAUDE_SONNET_5_5_MODEL,
128
116
  CLAUDE_SONNET_5_BEDROCK_MODEL,
129
- CLAUDE_SONNET_5_MODEL,
130
117
  CODEX_ASP_ITEM_ID_PAYLOAD_KEY,
131
118
  CODEX_HISTORY_FORMAT_EVENT_TYPE,
132
119
  CODEX_QUOTA_STATUS_EVENT_TYPE,
@@ -312,6 +299,7 @@ import {
312
299
  shouldRefreshPullRequests,
313
300
  spawnSubagentRequestSchema,
314
301
  stripAgentDiagnosticErrors,
302
+ toClaudeCodeModel,
315
303
  updateChatDisplayNameRequestSchema,
316
304
  waitSubagentRequestSchema,
317
305
  withTimeout,
@@ -319,7 +307,7 @@ import {
319
307
  workspaceCredentialProviderSchema,
320
308
  workspaceTokenRequestSchema,
321
309
  workspaceTokenResponseSchema
322
- } from "./chunk-BYJ6CIME.js";
310
+ } from "./chunk-4KMPRAV6.js";
323
311
  import {
324
312
  cloneMcpConfig,
325
313
  ensureCompatibilityImports,
@@ -13186,31 +13174,6 @@ function supportsClaudeThinkingDisplay(model) {
13186
13174
  const normalized = (normalizeClaudeModel(model) ?? model).toLowerCase();
13187
13175
  return AGENT_MODELS.claude.includes(normalized) || /^claude-(?:opus|sonnet|haiku)-[4-9]/.test(normalized);
13188
13176
  }
13189
- function toClaudeCodeModel(model, bedrock) {
13190
- if (!bedrock) {
13191
- return model;
13192
- }
13193
- switch (normalizeClaudeModel(model)) {
13194
- case CLAUDE_FABLE_5_1_MODEL:
13195
- return CLAUDE_FABLE_5_1_BEDROCK_MODEL;
13196
- case CLAUDE_FABLE_5_MODEL:
13197
- return CLAUDE_FABLE_5_BEDROCK_MODEL;
13198
- case CLAUDE_OPUS_5_5_MODEL:
13199
- return CLAUDE_OPUS_5_5_BEDROCK_MODEL;
13200
- case CLAUDE_OPUS_5_MODEL:
13201
- return CLAUDE_OPUS_5_BEDROCK_MODEL;
13202
- case CLAUDE_OPUS_4_8_MODEL:
13203
- return "opus";
13204
- case CLAUDE_SONNET_5_5_MODEL:
13205
- return CLAUDE_SONNET_5_5_BEDROCK_MODEL;
13206
- case CLAUDE_SONNET_5_MODEL:
13207
- return "sonnet";
13208
- case CLAUDE_HAIKU_4_5_MODEL:
13209
- return "haiku";
13210
- default:
13211
- return model;
13212
- }
13213
- }
13214
13177
  var TOOL_INPUT_HANDLERS = {
13215
13178
  ExitPlanMode: {
13216
13179
  getRequest: () => ({
@@ -60229,9 +60192,13 @@ function uploadChatTranscript(chatId, filePath, chat, capture) {
60229
60192
  async function uploadChatTranscriptNow(chatId, filePath, chat, capture) {
60230
60193
  const { size } = await stat5(filePath);
60231
60194
  if (size === 0) return null;
60195
+ const credential = chat && ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS[chat.provider];
60232
60196
  const metadata = chat ? {
60233
60197
  provider: chat.provider,
60234
- credential: ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS[chat.provider],
60198
+ credential,
60199
+ // Without a stored credential the agent can only have run on environment-variable auth.
60200
+ credentialSource: credential ? "stored" : detectAgentAuthMethod(chat.provider) === "none" ? void 0 : "environment",
60201
+ model: chat.model,
60235
60202
  title: chat.title,
60236
60203
  displayName: chat.displayName,
60237
60204
  createdAt: chat.createdAt,
@@ -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-YDKFWJY7.js";
6
+ } from "./chunk-MHGSYSA2.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-UZSNFLDQ.js";
10
10
  import {
11
11
  shouldRefreshPullRequests
12
- } from "./chunk-BYJ6CIME.js";
12
+ } from "./chunk-4KMPRAV6.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/services/post-tool-pr-notifier.ts
@@ -9,7 +9,7 @@ import {
9
9
  spawnSubagentRequestSchema,
10
10
  subagentResponseSchema,
11
11
  waitSubagentRequestSchema
12
- } from "./chunk-BYJ6CIME.js";
12
+ } from "./chunk-4KMPRAV6.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/subagent-mcp.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.965",
3
+ "version": "0.1.967",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",