replicas-engine 0.1.1197 → 0.1.1198
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.
- package/dist/src/{asp-host-3COSCSNX.js → asp-host-IQKGBXK7.js} +5 -5
- package/dist/src/{chunk-7LBCGK6Y.js → chunk-FVL7I22G.js} +4 -0
- package/dist/src/{chunk-FIBXPCOA.js → chunk-JHB7LYXE.js} +1 -1
- package/dist/src/{chunk-CNWTNVTV.js → chunk-JS6MHWMJ.js} +1 -1
- package/dist/src/{chunk-5QOV66P3.js → chunk-NIUZOQWF.js} +6 -6
- package/dist/src/{chunk-UVGABO3B.js → chunk-SJGXFLQH.js} +2 -2
- package/dist/src/{chunk-QO3GY73U.js → chunk-YZPKU23D.js} +3 -3
- package/dist/src/{chunk-ZR5BD5SR.js → chunk-ZKX5IHTB.js} +2 -2
- package/dist/src/{chunk-GK57LZQO.js → chunk-ZYAO2L47.js} +2 -2
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +33 -45
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
listRunningCodexModels,
|
|
9
9
|
restartCodexAspHost,
|
|
10
10
|
restartCodexAspHostIfRunning
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-NIUZOQWF.js";
|
|
12
|
+
import "./chunk-ZKX5IHTB.js";
|
|
13
|
+
import "./chunk-YZPKU23D.js";
|
|
14
|
+
import "./chunk-JHB7LYXE.js";
|
|
15
15
|
import "./chunk-UZSNFLDQ.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-FVL7I22G.js";
|
|
17
17
|
import "./chunk-VEQXQN22.js";
|
|
18
18
|
export {
|
|
19
19
|
CODEX_ULTRAFAST_SERVICE_TIER,
|
|
@@ -238,6 +238,7 @@ function parseRepoUrlSlug(url) {
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
// ../shared/src/urls.ts
|
|
241
|
+
var DEFAULT_WEB_APP_URL = "https://app.replicas.dev";
|
|
241
242
|
var DASHBOARD_PATH = "/dashboard";
|
|
242
243
|
var WEB_APP_PATHS = {
|
|
243
244
|
home: "/",
|
|
@@ -9949,6 +9950,7 @@ export {
|
|
|
9949
9950
|
DEFAULT_OLLAMA_MODEL,
|
|
9950
9951
|
getDefaultOllamaModel,
|
|
9951
9952
|
listOllamaModels,
|
|
9953
|
+
CREDENTIAL_SCOPE,
|
|
9952
9954
|
CREDENTIAL_METHOD,
|
|
9953
9955
|
detectEnvironmentAuthMethod,
|
|
9954
9956
|
AGENT_CREDENTIAL_METHODS_IN_ORDER,
|
|
@@ -9975,6 +9977,8 @@ export {
|
|
|
9975
9977
|
DEFAULT_OPENCODE_GO_MODEL,
|
|
9976
9978
|
fetchOpenCodeGoCatalog,
|
|
9977
9979
|
isGitHubUrl,
|
|
9980
|
+
DEFAULT_WEB_APP_URL,
|
|
9981
|
+
WEB_APP_PATHS,
|
|
9978
9982
|
parseCodeHostPrUrl,
|
|
9979
9983
|
decodePathSegments,
|
|
9980
9984
|
buildCodeHostPrUrl,
|
|
@@ -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-
|
|
6
|
+
} from "./chunk-FVL7I22G.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -10,15 +10,15 @@ import {
|
|
|
10
10
|
resolveDiffBase,
|
|
11
11
|
runGitCommand,
|
|
12
12
|
setAgentCredentialSnapshot
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZKX5IHTB.js";
|
|
14
14
|
import {
|
|
15
15
|
AppServerProcess,
|
|
16
16
|
buildCodexAgentEnv
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-YZPKU23D.js";
|
|
18
18
|
import {
|
|
19
19
|
SUBPROCESS_MAX_BUFFER,
|
|
20
20
|
execFileAsync
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JHB7LYXE.js";
|
|
22
22
|
import {
|
|
23
23
|
isRecord
|
|
24
24
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
resolveOpenAICompatibleModelsUrl,
|
|
56
56
|
splitMothershipInstructions,
|
|
57
57
|
withTimeout
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-FVL7I22G.js";
|
|
59
59
|
|
|
60
60
|
// src/managers/codex-token-manager.ts
|
|
61
61
|
import { promises as fs } from "fs";
|
|
@@ -291,7 +291,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
291
291
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
292
292
|
await this.applyCredentialsResponse(data);
|
|
293
293
|
setAgentCredentialSnapshot("codex", data);
|
|
294
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
294
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-IQKGBXK7.js");
|
|
295
295
|
await restartCodexAspHostIfRunning2();
|
|
296
296
|
});
|
|
297
297
|
await this.start(true);
|
|
@@ -313,7 +313,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
313
313
|
const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
|
|
314
314
|
await this.applyCredentialsResponse(data);
|
|
315
315
|
if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
|
|
316
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
316
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-IQKGBXK7.js");
|
|
317
317
|
await restartCodexAspHostIfRunning2();
|
|
318
318
|
}
|
|
319
319
|
setAgentCredentialSnapshot("codex", data);
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
AspClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YZPKU23D.js";
|
|
7
7
|
import {
|
|
8
8
|
ASTER_BASE_URL,
|
|
9
9
|
ASTER_PROVIDER,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
isRecord,
|
|
14
14
|
readOllamaAuthEnv,
|
|
15
15
|
readOpenAICompatibleAuthEnv
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-FVL7I22G.js";
|
|
17
17
|
|
|
18
18
|
// src/managers/codex-asp/notification-dispatch.ts
|
|
19
19
|
var TURN_STARTED_METHOD = "turn/started";
|
|
@@ -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-
|
|
6
|
+
} from "./chunk-JHB7LYXE.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FVL7I22G.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.
|
|
243
|
+
var ENGINE_PACKAGE_VERSION = "0.1.1198";
|
|
244
244
|
var INITIALIZE_METHOD = "initialize";
|
|
245
245
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
246
246
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
SUBPROCESS_MAX_BUFFER,
|
|
6
6
|
execFileAsync
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JHB7LYXE.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord as isRecord2
|
|
10
10
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
isValidAgentProvider,
|
|
19
19
|
parsePosixEnvFile,
|
|
20
20
|
readReplicasRuntimeEnv
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-FVL7I22G.js";
|
|
22
22
|
|
|
23
23
|
// src/runtime-env-loader.ts
|
|
24
24
|
import { readFileSync } from "fs";
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
getOriginDefaultBranch,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
runGitCommand
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZKX5IHTB.js";
|
|
9
9
|
import {
|
|
10
10
|
extractCommandProtectionCommandText,
|
|
11
11
|
findCommandProtectionGitLookups,
|
|
12
12
|
findGitCommitSignals,
|
|
13
13
|
findPrMergeSignals,
|
|
14
14
|
parseCommandProtectionRequest
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FVL7I22G.js";
|
|
16
16
|
|
|
17
17
|
// src/services/command-protection-service.ts
|
|
18
18
|
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-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-ZYAO2L47.js";
|
|
7
|
+
import "./chunk-ZKX5IHTB.js";
|
|
8
|
+
import "./chunk-JHB7LYXE.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-FVL7I22G.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/command-protection-hook.ts
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
recoverCompletedTurn,
|
|
14
14
|
spawnMuseMsp,
|
|
15
15
|
startMuseSession
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-SJGXFLQH.js";
|
|
17
17
|
import {
|
|
18
18
|
AppServerProcess,
|
|
19
19
|
buildCodexAgentEnv
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-YZPKU23D.js";
|
|
21
|
+
import "./chunk-JHB7LYXE.js";
|
|
22
22
|
import {
|
|
23
23
|
AGENT,
|
|
24
24
|
OPENCODE_GO_PROVIDER,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
headlessAgentUsagePath,
|
|
29
29
|
isRecord,
|
|
30
30
|
withTimeout
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-FVL7I22G.js";
|
|
32
32
|
import "./chunk-VEQXQN22.js";
|
|
33
33
|
|
|
34
34
|
// src/headless-agent.ts
|
package/dist/src/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
evaluateCommandProtection,
|
|
28
28
|
extractToolCommand,
|
|
29
29
|
reportCommandProtectionBlock
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-ZYAO2L47.js";
|
|
31
31
|
import {
|
|
32
32
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
33
33
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -64,10 +64,10 @@ import {
|
|
|
64
64
|
spawnMuseMsp,
|
|
65
65
|
startMuseSession,
|
|
66
66
|
uuidV7
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-SJGXFLQH.js";
|
|
68
68
|
import {
|
|
69
69
|
publishedPullRequestUrls
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-JS6MHWMJ.js";
|
|
71
71
|
import {
|
|
72
72
|
ACCOUNT_RATE_LIMITS_READ_METHOD,
|
|
73
73
|
AsyncLock,
|
|
@@ -139,7 +139,7 @@ import {
|
|
|
139
139
|
timestampFromSeconds,
|
|
140
140
|
upsertCredentialFileLines,
|
|
141
141
|
writeSecureCredentialFile
|
|
142
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-NIUZOQWF.js";
|
|
143
143
|
import {
|
|
144
144
|
ENGINE_ENV,
|
|
145
145
|
monolithRequest,
|
|
@@ -148,15 +148,15 @@ import {
|
|
|
148
148
|
reloadEngineEnv,
|
|
149
149
|
resolveDiffBase,
|
|
150
150
|
setAgentCredentialSnapshot
|
|
151
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-ZKX5IHTB.js";
|
|
152
152
|
import {
|
|
153
153
|
getCodexModelProvider
|
|
154
|
-
} from "./chunk-
|
|
154
|
+
} from "./chunk-YZPKU23D.js";
|
|
155
155
|
import {
|
|
156
156
|
SUBPROCESS_MAX_BUFFER,
|
|
157
157
|
execAsync,
|
|
158
158
|
execFileAsync
|
|
159
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-JHB7LYXE.js";
|
|
160
160
|
import {
|
|
161
161
|
isRecord as isRecord2
|
|
162
162
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -190,6 +190,7 @@ import {
|
|
|
190
190
|
CODEX_QUOTA_STATUS_EVENT_TYPE,
|
|
191
191
|
CONTEXT_USAGE_EVENT_TYPE,
|
|
192
192
|
CREDENTIAL_METHOD,
|
|
193
|
+
CREDENTIAL_SCOPE,
|
|
193
194
|
CURSOR_CONNECTION_STATUS_EVENT_TYPE,
|
|
194
195
|
CodexHistoryEventFolder,
|
|
195
196
|
DEFAULT_ASTER_MODEL,
|
|
@@ -202,6 +203,7 @@ import {
|
|
|
202
203
|
DEFAULT_OPENCODE_MODEL,
|
|
203
204
|
DEFAULT_PI_MODEL,
|
|
204
205
|
DEFAULT_START_HOOK_TIMEOUT_MS,
|
|
206
|
+
DEFAULT_WEB_APP_URL,
|
|
205
207
|
DESKTOP_STREAM_PORT,
|
|
206
208
|
ENGINE_ACTIVATE_PATH,
|
|
207
209
|
ENGINE_HEALTH_MAX_WAIT_MS,
|
|
@@ -244,6 +246,7 @@ import {
|
|
|
244
246
|
TOKEN_USAGE_PATH,
|
|
245
247
|
TaskAccumulator,
|
|
246
248
|
USER_MESSAGE_ID_PAYLOAD_KEY,
|
|
249
|
+
WEB_APP_PATHS,
|
|
247
250
|
WORKSPACE_IDENTITY_AUDIENCE,
|
|
248
251
|
agentCredentialSnapshotSchema,
|
|
249
252
|
agentQuotaExhaustedPayloadSchema,
|
|
@@ -388,7 +391,7 @@ import {
|
|
|
388
391
|
workspaceTokenRequestSchema,
|
|
389
392
|
workspaceTokenResponseSchema,
|
|
390
393
|
wrapInTag
|
|
391
|
-
} from "./chunk-
|
|
394
|
+
} from "./chunk-FVL7I22G.js";
|
|
392
395
|
import {
|
|
393
396
|
cloneMcpConfig,
|
|
394
397
|
ensureCompatibilityImports,
|
|
@@ -11063,7 +11066,7 @@ var QUOTA_STOP_NEXT_STEP = {
|
|
|
11063
11066
|
function describeQuotaExhaustion(provider, reason, credential, fallback) {
|
|
11064
11067
|
const agent = getProviderDisplayName(provider);
|
|
11065
11068
|
const account = credential ? describeCredential(provider, credential) : "the credential this workspace is using";
|
|
11066
|
-
const limit = reason === "out_of_credits" ? `${agent} ran out of credits on ${account}.` :
|
|
11069
|
+
const limit = reason === "out_of_credits" ? `${agent} ran out of credits on ${account}.` : `${agent} hit the usage limit on ${account}.`;
|
|
11067
11070
|
const next = fallback.outcome === "fork" ? `Continuing in ${getProviderDisplayName(fallback.target.provider, "long")}.` : QUOTA_STOP_NEXT_STEP[fallback.outcome];
|
|
11068
11071
|
return `${limit} ${next}`;
|
|
11069
11072
|
}
|
|
@@ -11104,8 +11107,9 @@ var AuthFallbackCoordinator = class {
|
|
|
11104
11107
|
let failed = false;
|
|
11105
11108
|
for (const step of steps) {
|
|
11106
11109
|
if (step.kind === "harness") {
|
|
11107
|
-
if (forkable
|
|
11108
|
-
|
|
11110
|
+
if (!forkable || !isAgentAvailable(step.provider)) continue;
|
|
11111
|
+
if (reason === "auth_failed") break;
|
|
11112
|
+
return { outcome: "fork", target: step };
|
|
11109
11113
|
}
|
|
11110
11114
|
if (alreadyReplaced && live) {
|
|
11111
11115
|
if (step.methods.length > 0 && !step.methods.includes(live.method)) continue;
|
|
@@ -13047,8 +13051,8 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13047
13051
|
}
|
|
13048
13052
|
async processMessageInternal(request, signal) {
|
|
13049
13053
|
let lastError;
|
|
13050
|
-
let
|
|
13051
|
-
let
|
|
13054
|
+
let failedLogin;
|
|
13055
|
+
let loginRevoked = false;
|
|
13052
13056
|
let fallbacks = 0;
|
|
13053
13057
|
let attempt = 0;
|
|
13054
13058
|
let authRetries = 0;
|
|
@@ -13090,9 +13094,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13090
13094
|
attempt++;
|
|
13091
13095
|
continue;
|
|
13092
13096
|
}
|
|
13093
|
-
|
|
13094
|
-
revokedLogin = attemptedCredential;
|
|
13095
|
-
}
|
|
13097
|
+
loginRevoked = attemptedCredential?.method === "oauth" && refreshed.error.message.includes('"code":"oauth_disconnected"');
|
|
13096
13098
|
}
|
|
13097
13099
|
if (quotaKind || isAuthError) {
|
|
13098
13100
|
const reason = quotaKind ?? "auth_failed";
|
|
@@ -13102,16 +13104,16 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13102
13104
|
if (fallback.model) currentRequest = { ...currentRequest, model: fallback.model };
|
|
13103
13105
|
fallbacks++;
|
|
13104
13106
|
authRetries = 0;
|
|
13105
|
-
|
|
13107
|
+
loginRevoked = false;
|
|
13106
13108
|
await this.tearDownSession();
|
|
13107
13109
|
attempt++;
|
|
13108
13110
|
continue;
|
|
13109
13111
|
}
|
|
13110
|
-
if (quotaKind
|
|
13111
|
-
await this.emitQuotaExhaustedEvent(
|
|
13112
|
+
if (quotaKind) {
|
|
13113
|
+
await this.emitQuotaExhaustedEvent(quotaKind, fallback, detail, attemptedCredential);
|
|
13112
13114
|
return;
|
|
13113
13115
|
}
|
|
13114
|
-
|
|
13116
|
+
failedLogin = { credential: attemptedCredential, revoked: loginRevoked };
|
|
13115
13117
|
throw error;
|
|
13116
13118
|
}
|
|
13117
13119
|
if (error instanceof ClaudeMissingSessionError && !missingSessionReset) {
|
|
@@ -13158,8 +13160,8 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13158
13160
|
}
|
|
13159
13161
|
} finally {
|
|
13160
13162
|
this.setAuthRetrying(false);
|
|
13161
|
-
if (
|
|
13162
|
-
await this.emitAuthRetryExhaustedEvent(lastError,
|
|
13163
|
+
if (failedLogin) {
|
|
13164
|
+
await this.emitAuthRetryExhaustedEvent(lastError, failedLogin.credential, failedLogin.revoked);
|
|
13163
13165
|
}
|
|
13164
13166
|
try {
|
|
13165
13167
|
await this.historyFile.flush();
|
|
@@ -13188,30 +13190,16 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13188
13190
|
this.historyFile.append(event);
|
|
13189
13191
|
this.onEvent(event);
|
|
13190
13192
|
}
|
|
13191
|
-
async emitAuthRetryExhaustedEvent(error,
|
|
13193
|
+
async emitAuthRetryExhaustedEvent(error, login, revoked) {
|
|
13192
13194
|
const detail = error instanceof Error ? error.message : String(error);
|
|
13193
|
-
await this.emitTerminalErrorResult(
|
|
13194
|
-
|
|
13195
|
-
|
|
13196
|
-
);
|
|
13197
|
-
|
|
13198
|
-
|
|
13199
|
-
|
|
13200
|
-
|
|
13201
|
-
return `Anthropic rejected ${login} Claude Code login (it was signed out, revoked, or expired), so it couldn't be refreshed. Reconnect ${login} Claude Code login in Settings \u2192 Agents and try again.`;
|
|
13202
|
-
}
|
|
13203
|
-
switch (resolveClaudeAuthMethodForMessage()) {
|
|
13204
|
-
case "oauth":
|
|
13205
|
-
return "Claude Code OAuth authentication failed after refreshing credentials. Reconnect Claude Code in Settings \u2192 Agents and try again.";
|
|
13206
|
-
case "api_key":
|
|
13207
|
-
return "Anthropic API key authentication failed. The key may be invalid, revoked, out of credits, or missing access to the selected Claude model. Update the Anthropic API key in Settings \u2192 Agents and try again.";
|
|
13208
|
-
case "bedrock":
|
|
13209
|
-
return "AWS Bedrock authentication failed. Check the Bedrock credentials, region, IAM permissions, and Claude model access in Settings \u2192 Agents, then try again.";
|
|
13210
|
-
case "foundry":
|
|
13211
|
-
return "Microsoft Foundry authentication failed. Check the API key, resource, and Claude deployment names in Settings \u2192 Agents, then try again.";
|
|
13212
|
-
default:
|
|
13213
|
-
return "Claude authentication failed after multiple attempts. Check your Claude, Anthropic API key, or Bedrock credentials in Settings \u2192 Agents and try again.";
|
|
13214
|
-
}
|
|
13195
|
+
await this.emitTerminalErrorResult(detail, [_ClaudeManager.authFailureMessage(login, revoked)]);
|
|
13196
|
+
}
|
|
13197
|
+
static authFailureMessage(login, revoked) {
|
|
13198
|
+
const method = login?.method ?? resolveClaudeAuthMethodForMessage();
|
|
13199
|
+
const name = login ? describeCredential("claude", login) : "the Claude credential this workspace uses";
|
|
13200
|
+
const why = revoked ? "It was signed out, revoked, or expired." : method === "api_key" ? "The key may be invalid, revoked, out of credits, or missing access to the selected model." : method === "bedrock" ? "Check its credentials, region, IAM permissions, and Claude model access." : method === "foundry" ? "Check its API key, resource, and Claude deployment names." : "It was rejected even after a refresh.";
|
|
13201
|
+
const reconnect = login?.scope === CREDENTIAL_SCOPE.ORG ? `An organization admin can reconnect it in Organization \u2192 Coding Agents: ${DEFAULT_WEB_APP_URL}${WEB_APP_PATHS.agents}` : `Reconnect it in Personal \u2192 Coding Agents: ${DEFAULT_WEB_APP_URL}${WEB_APP_PATHS.accountAgents}`;
|
|
13202
|
+
return `Claude could not sign in with ${name}. ${why} ${reconnect}`;
|
|
13215
13203
|
}
|
|
13216
13204
|
async emitQuotaExhaustedEvent(kind, fallback, detail, credential) {
|
|
13217
13205
|
await this.emitTerminalErrorResult(detail, [describeQuotaExhaustion("claude", kind, credential, fallback)]);
|
|
@@ -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-
|
|
6
|
+
} from "./chunk-JS6MHWMJ.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
9
|
} from "./chunk-UZSNFLDQ.js";
|
|
10
10
|
import {
|
|
11
11
|
shouldRefreshPullRequests
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FVL7I22G.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/services/post-tool-pr-notifier.ts
|
package/dist/src/subagent-mcp.js
CHANGED