replicas-engine 0.1.775 → 0.1.776

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-GGT6UJ6C.js";
9
- import "./chunk-Z57YNVDC.js";
10
- import "./chunk-OKJ44POW.js";
8
+ } from "./chunk-OVQGTUPL.js";
9
+ import "./chunk-NPFAPMJ3.js";
10
+ import "./chunk-RP4LIWKF.js";
11
11
  import "./chunk-UZSNFLDQ.js";
12
- import "./chunk-TFTQG4KD.js";
12
+ import "./chunk-3PHLWZEX.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
  export {
15
15
  getCodexAspHost,
@@ -492,7 +492,8 @@ var CREDENTIAL_TYPE = {
492
492
  ASTER_API_KEY: "aster_api_key",
493
493
  OPENROUTER_API_KEY: "openrouter_api_key",
494
494
  AI_GATEWAY_API_KEY: "ai_gateway_api_key",
495
- MUSE_OAUTH: "muse_oauth"
495
+ MUSE_OAUTH: "muse_oauth",
496
+ MUSE_API_KEY: "muse_api_key"
496
497
  };
497
498
  var INFERENCE_PROVIDER_LABELS = {
498
499
  [CREDENTIAL_METHOD.OPENCODE_GO]: "OpenCode Go",
@@ -525,7 +526,8 @@ var AGENT_CREDENTIAL_METHODS_IN_ORDER = {
525
526
  { method: CREDENTIAL_METHOD.AI_GATEWAY, credentialType: CREDENTIAL_TYPE.AI_GATEWAY_API_KEY }
526
527
  ],
527
528
  [AGENT.MUSE]: [
528
- { method: CREDENTIAL_METHOD.MUSE_OAUTH, credentialType: CREDENTIAL_TYPE.MUSE_OAUTH }
529
+ { method: CREDENTIAL_METHOD.MUSE_OAUTH, credentialType: CREDENTIAL_TYPE.MUSE_OAUTH },
530
+ { method: CREDENTIAL_METHOD.API_KEY, credentialType: CREDENTIAL_TYPE.MUSE_API_KEY }
529
531
  ],
530
532
  [AGENT.OPENCODE]: [
531
533
  { method: CREDENTIAL_METHOD.OPENCODE_GO, credentialType: CREDENTIAL_TYPE.OPENCODE_GO_API_KEY },
@@ -545,6 +547,7 @@ function getCredentialMethodLabel(agent, method) {
545
547
  case CREDENTIAL_METHOD.API_KEY:
546
548
  if (agent === AGENT.CODEX) return "OpenAI API key";
547
549
  if (agent === AGENT.CURSOR) return "Cursor API key";
550
+ if (agent === AGENT.MUSE) return "Muse API key";
548
551
  return "Anthropic API key";
549
552
  case CREDENTIAL_METHOD.OPENAI_COMPATIBLE:
550
553
  return "OpenAI-compatible endpoint";
@@ -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-Z57YNVDC.js";
6
+ } from "./chunk-NPFAPMJ3.js";
7
7
  import {
8
8
  extractCommandProtectionCommandText,
9
9
  findGitCommitSignals,
10
10
  findPrMergeSignals
11
- } from "./chunk-TFTQG4KD.js";
11
+ } from "./chunk-3PHLWZEX.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-TFTQG4KD.js";
18
+ } from "./chunk-3PHLWZEX.js";
19
19
 
20
20
  // src/engine-env.ts
21
21
  import { readFileSync as readFileSync2 } from "fs";
@@ -89,6 +89,9 @@ function parseCodexAuthMethod(value) {
89
89
  }
90
90
  return void 0;
91
91
  }
92
+ function parseMuseAuthMethod(value) {
93
+ return value === "oauth" || value === "api_key" ? value : void 0;
94
+ }
92
95
  function parseAgentCredentialSnapshots(value) {
93
96
  if (!value) return {};
94
97
  try {
@@ -142,6 +145,7 @@ function loadEngineEnv() {
142
145
  ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION: readEnv("ANTHROPIC_SMALL_FAST_MODEL_AWS_REGION"),
143
146
  REPLICAS_CLAUDE_AUTH_METHOD: parseClaudeAuthMethod(readEnv("REPLICAS_CLAUDE_AUTH_METHOD")),
144
147
  REPLICAS_CODEX_AUTH_METHOD: parseCodexAuthMethod(readEnv("REPLICAS_CODEX_AUTH_METHOD")),
148
+ REPLICAS_MUSE_AUTH_METHOD: parseMuseAuthMethod(readEnv("REPLICAS_MUSE_AUTH_METHOD")),
145
149
  REPLICAS_AGENT_CREDENTIALS: parseAgentCredentialSnapshots(readEnv("REPLICAS_AGENT_CREDENTIALS")),
146
150
  REPLICAS_ENV_SYSTEM_PROMPT: readEnv("REPLICAS_ENV_SYSTEM_PROMPT"),
147
151
  REPLICAS_ENV_START_HOOK: readEnv("REPLICAS_ENV_START_HOOK"),
@@ -5,18 +5,18 @@ import {
5
5
  ENGINE_ENV,
6
6
  monolithRequest,
7
7
  setAgentCredentialSnapshot
8
- } from "./chunk-Z57YNVDC.js";
8
+ } from "./chunk-NPFAPMJ3.js";
9
9
  import {
10
10
  AppServerProcess,
11
11
  buildCodexAgentEnv
12
- } from "./chunk-OKJ44POW.js";
12
+ } from "./chunk-RP4LIWKF.js";
13
13
  import {
14
14
  CODEX_AUTH_ENV_KEYS,
15
15
  CODEX_AUTH_ENV_KEYS_BY_METHOD,
16
16
  codexAuthEnvFromResponse,
17
17
  createErrorResult,
18
18
  createSuccessResult
19
- } from "./chunk-TFTQG4KD.js";
19
+ } from "./chunk-3PHLWZEX.js";
20
20
 
21
21
  // src/managers/codex-token-manager.ts
22
22
  import { promises as fs } from "fs";
@@ -232,7 +232,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
232
232
  const data = await response.json();
233
233
  await this.applyCredentialsResponse(data);
234
234
  if (restartOnChange && CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index])) {
235
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-U2OGXHF3.js");
235
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-HKSTCW5T.js");
236
236
  await restartCodexAspHostIfRunning2();
237
237
  }
238
238
  if (data.scope) {
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  findCodeHostPullRequestUrls,
6
6
  mayCreatePullRequest
7
- } from "./chunk-TFTQG4KD.js";
7
+ } from "./chunk-3PHLWZEX.js";
8
8
 
9
9
  // src/services/post-tool-pr-notifier.ts
10
10
  async function notifyPostToolUse(toolName, toolInput, toolResult) {
@@ -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-TFTQG4KD.js";
7
+ } from "./chunk-3PHLWZEX.js";
8
8
 
9
9
  // src/utils/codex-agent-env.ts
10
10
  function buildCodexAgentEnv(source = process.env) {
@@ -241,7 +241,7 @@ var DEFAULT_CODEX_ARGS = [
241
241
  var MIN_CODEX_CLI_VERSION = "0.153.3";
242
242
  var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
243
243
  var codexCliVersionEnsured = null;
244
- var ENGINE_PACKAGE_VERSION = "0.1.775";
244
+ var ENGINE_PACKAGE_VERSION = "0.1.776";
245
245
  var INITIALIZE_METHOD = "initialize";
246
246
  var INITIALIZED_NOTIFICATION = "initialized";
247
247
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -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-LPIM74UP.js";
7
- import "./chunk-Z57YNVDC.js";
6
+ } from "./chunk-GICTTMFH.js";
7
+ import "./chunk-NPFAPMJ3.js";
8
8
  import {
9
9
  isRecord
10
10
  } from "./chunk-UZSNFLDQ.js";
11
- import "./chunk-TFTQG4KD.js";
11
+ import "./chunk-3PHLWZEX.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-LPIM74UP.js";
6
+ } from "./chunk-GICTTMFH.js";
7
7
  import {
8
8
  notifyPostToolUse
9
- } from "./chunk-SNVON4L7.js";
10
- import "./chunk-Z57YNVDC.js";
9
+ } from "./chunk-OX5DTL5R.js";
10
+ import "./chunk-NPFAPMJ3.js";
11
11
  import "./chunk-UZSNFLDQ.js";
12
- import "./chunk-TFTQG4KD.js";
12
+ import "./chunk-3PHLWZEX.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-OKJ44POW.js";
11
+ } from "./chunk-RP4LIWKF.js";
12
12
  import {
13
13
  AGENT,
14
14
  getMemoryOutputSafetyViolation,
15
15
  headlessAgentRequestSchema
16
- } from "./chunk-TFTQG4KD.js";
16
+ } from "./chunk-3PHLWZEX.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-LPIM74UP.js";
94
+ } from "./chunk-GICTTMFH.js";
95
95
  import {
96
96
  ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
97
97
  AGENT_MESSAGE_DELTA_METHOD,
@@ -124,20 +124,20 @@ import {
124
124
  recordCredentialFallback,
125
125
  recordExhaustedCredential,
126
126
  restartCodexAspHost
127
- } from "./chunk-GGT6UJ6C.js";
127
+ } from "./chunk-OVQGTUPL.js";
128
128
  import {
129
129
  ENGINE_ENV,
130
130
  IS_WARMING_MODE,
131
131
  monolithRequest,
132
132
  monolithService,
133
133
  setAgentCredentialSnapshot
134
- } from "./chunk-Z57YNVDC.js";
134
+ } from "./chunk-NPFAPMJ3.js";
135
135
  import {
136
136
  AspClient,
137
137
  SUBPROCESS_MAX_BUFFER,
138
138
  execAsync,
139
139
  execFileAsync
140
- } from "./chunk-OKJ44POW.js";
140
+ } from "./chunk-RP4LIWKF.js";
141
141
  import {
142
142
  isRecord as isRecord2
143
143
  } from "./chunk-UZSNFLDQ.js";
@@ -337,7 +337,7 @@ import {
337
337
  spawnRelaySubagentRequestSchema,
338
338
  stripAgentDiagnosticErrors,
339
339
  withTimeout
340
- } from "./chunk-TFTQG4KD.js";
340
+ } from "./chunk-3PHLWZEX.js";
341
341
  import {
342
342
  __commonJS,
343
343
  __export,
@@ -9771,7 +9771,10 @@ function detectAgentAuthMethod(provider) {
9771
9771
  case AGENT.KIMI:
9772
9772
  return ENGINE_ENV.AI_GATEWAY_API_KEY ? "api_key" : "none";
9773
9773
  case AGENT.MUSE:
9774
- return existsSync2(MUSE_AUTH_PATH) ? "oauth" : "none";
9774
+ if (!existsSync2(MUSE_AUTH_PATH)) return "none";
9775
+ if (ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.muse?.method === "api_key") return "api_key";
9776
+ if (ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.muse?.method === "muse-oauth") return "oauth";
9777
+ return ENGINE_ENV.REPLICAS_MUSE_AUTH_METHOD ?? "oauth";
9775
9778
  case AGENT.OPENCODE:
9776
9779
  return existsSync2(OPENCODE_AUTH_PATH) ? "api_key" : "none";
9777
9780
  case AGENT.PI:
@@ -11318,7 +11321,7 @@ var MuseTokenManager = class extends BaseRefreshManager {
11318
11321
  allowedMethods,
11319
11322
  refresh: async (exclusions) => {
11320
11323
  const request = {
11321
- failedMethod: CREDENTIAL_METHOD.MUSE_OAUTH,
11324
+ failedMethod: failedCredential?.method === CREDENTIAL_METHOD.API_KEY ? CREDENTIAL_METHOD.API_KEY : CREDENTIAL_METHOD.MUSE_OAUTH,
11322
11325
  ...failedCredential ? { failedCredential } : {},
11323
11326
  failureReason,
11324
11327
  failureKind,
@@ -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-SNVON4L7.js";
6
+ } from "./chunk-OX5DTL5R.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-UZSNFLDQ.js";
10
- import "./chunk-TFTQG4KD.js";
10
+ import "./chunk-3PHLWZEX.js";
11
11
  import "./chunk-VEQXQN22.js";
12
12
 
13
13
  // src/post-tool-pr-hook.ts
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  messageRelaySubagentRequestSchema,
6
6
  spawnRelaySubagentRequestSchema
7
- } from "./chunk-TFTQG4KD.js";
7
+ } from "./chunk-3PHLWZEX.js";
8
8
  import "./chunk-VEQXQN22.js";
9
9
 
10
10
  // src/relay-mcp.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.775",
3
+ "version": "0.1.776",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",