replicas-engine 0.1.1205 → 0.1.1207
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-OFW4G2ZY.js → asp-host-AMENRRVC.js} +5 -5
- package/dist/src/{chunk-GJWKAJ3W.js → chunk-7KFWEP2H.js} +1 -1
- package/dist/src/{chunk-LRWX3RVK.js → chunk-BDG3ZBSX.js} +2 -2
- package/dist/src/{chunk-F6P4HPLK.js → chunk-EF6KRJ3M.js} +6 -6
- package/dist/src/{chunk-QAFVTJ54.js → chunk-HFDKOF2D.js} +2 -2
- package/dist/src/{chunk-4CC2RD7Z.js → chunk-HHE27FT5.js} +3 -3
- package/dist/src/{chunk-UZTCADJX.js → chunk-KDEQVFNS.js} +2 -2
- package/dist/src/{chunk-AOE7OYWW.js → chunk-T2AQMKMR.js} +22 -2
- package/dist/src/{chunk-GV2AISTI.js → chunk-V6WTK62K.js} +1 -1
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +20 -18
- 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-EF6KRJ3M.js";
|
|
12
|
+
import "./chunk-KDEQVFNS.js";
|
|
13
|
+
import "./chunk-HHE27FT5.js";
|
|
14
|
+
import "./chunk-7KFWEP2H.js";
|
|
15
15
|
import "./chunk-UZSNFLDQ.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-T2AQMKMR.js";
|
|
17
17
|
import "./chunk-VEQXQN22.js";
|
|
18
18
|
export {
|
|
19
19
|
CODEX_ULTRAFAST_SERVICE_TIER,
|
|
@@ -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-T2AQMKMR.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
getOriginDefaultBranch,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
runGitCommand
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KDEQVFNS.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-T2AQMKMR.js";
|
|
16
16
|
|
|
17
17
|
// src/services/command-protection-service.ts
|
|
18
18
|
import { readFile, stat } from "fs/promises";
|
|
@@ -10,15 +10,15 @@ import {
|
|
|
10
10
|
resolveDiffBase,
|
|
11
11
|
runGitCommand,
|
|
12
12
|
setAgentCredentialSnapshot
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KDEQVFNS.js";
|
|
14
14
|
import {
|
|
15
15
|
AppServerProcess,
|
|
16
16
|
buildCodexAgentEnv
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-HHE27FT5.js";
|
|
18
18
|
import {
|
|
19
19
|
SUBPROCESS_MAX_BUFFER,
|
|
20
20
|
execFileAsync
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-7KFWEP2H.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-T2AQMKMR.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-AMENRRVC.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-AMENRRVC.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-HHE27FT5.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-T2AQMKMR.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-7KFWEP2H.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-T2AQMKMR.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.1207";
|
|
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-7KFWEP2H.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-T2AQMKMR.js";
|
|
22
22
|
|
|
23
23
|
// src/runtime-env-loader.ts
|
|
24
24
|
import { readFileSync } from "fs";
|
|
@@ -870,7 +870,7 @@ function paginateEngineLogContent(input) {
|
|
|
870
870
|
}
|
|
871
871
|
|
|
872
872
|
// ../shared/src/agent-quota.ts
|
|
873
|
-
var AGENT_FALLBACK_REASONS = ["rate_limit", "out_of_credits", "auth_failed"];
|
|
873
|
+
var AGENT_FALLBACK_REASONS = ["rate_limit", "out_of_credits", "credits_required", "auth_failed"];
|
|
874
874
|
function isAgentFallbackReason(value) {
|
|
875
875
|
return AGENT_FALLBACK_REASONS.some((reason) => reason === value);
|
|
876
876
|
}
|
|
@@ -2173,7 +2173,7 @@ function describeAuthFallback(payload) {
|
|
|
2173
2173
|
});
|
|
2174
2174
|
const switched = payload.status === "switched";
|
|
2175
2175
|
return {
|
|
2176
|
-
headline: payload.reason === "out_of_credits" ? `${agent} is out of credits on ${exhausted}` : payload.reason === "auth_failed" ? `${agent} could not authenticate with ${exhausted}` : `${agent} hit its usage limit on ${exhausted}`,
|
|
2176
|
+
headline: payload.reason === "out_of_credits" ? `${agent} is out of credits on ${exhausted}` : payload.reason === "auth_failed" ? `${agent} could not authenticate with ${exhausted}` : payload.reason === "credits_required" ? `The selected model needs usage credits on ${exhausted}` : `${agent} hit its usage limit on ${exhausted}`,
|
|
2177
2177
|
outcomeClause: switched ? `switched to ${describeCredential(payload.provider, {
|
|
2178
2178
|
method: payload.candidateMethod,
|
|
2179
2179
|
scope: payload.candidateScope,
|
|
@@ -2255,6 +2255,7 @@ var forkChatRequestSchema = z9.object({
|
|
|
2255
2255
|
});
|
|
2256
2256
|
function describeQuotaLimit(reason) {
|
|
2257
2257
|
if (reason === "auth_failed") return "could not authenticate";
|
|
2258
|
+
if (reason === "credits_required") return "needed usage credits for the selected model";
|
|
2258
2259
|
return reason === "out_of_credits" ? "ran out of credits" : "hit its usage limit";
|
|
2259
2260
|
}
|
|
2260
2261
|
function describeChatForkReason(reason, provider2) {
|
|
@@ -5490,12 +5491,14 @@ var VISUAL_PAGE_RULES = `- Write one self-contained HTML file with inline <style
|
|
|
5490
5491
|
- Let content set the height. Never use 100vh, height:100%, or min-height:100vh on html, body, or the outer element; publishing refuses a page whose height follows the frame. Give charts fixed pixel heights.
|
|
5491
5492
|
- Color everything with the theme variables so the page follows light and dark mode live: --foreground, --muted-foreground (secondary text), --background, --muted (subtle fills), --accent, --border, --primary and --primary-foreground (Replicas green), --destructive, --warning, --code-background, --code-foreground, and --chart-1 to --chart-6 for series (use them in order and label series directly). Never hardcode a light or dark palette. A canvas or chart library that needs literal colors can read them with getComputedStyle(document.documentElement) and redraw on matchMedia("(prefers-color-scheme: dark)") changes.
|
|
5492
5493
|
- Text is 13px General Sans, like the chat; --font-sans and --font-mono are set. Keep Replicas' flat look: separate sections with 1px var(--border) lines or var(--muted) fills, without shadows or rounded cards. Use var(--radius) only on small controls.
|
|
5494
|
+
- A mockup of a specific product's UI, such as a client's app or a competitor's screen, is the exception: give it its own panel with at least 16px of padding and use that product's real colors, fonts, corners, and shadows inside it, so it looks like the product. Everything around the panel follows the rules above.
|
|
5493
5495
|
- Interaction is welcome: hover details, tabs, toggles, sliders. Links open in a new browser tab.
|
|
5494
5496
|
- Keep the top-right corner (about 110\xD740px) free of anything essential: the chat shows the visual's actions there on hover.`;
|
|
5495
5497
|
var THEME_FRAGMENT_KEY = "replicas-theme";
|
|
5496
5498
|
var HOST_CONTEXT_CHANGED_METHOD = "ui/notifications/host-context-changed";
|
|
5497
5499
|
var SIZE_CHANGED_METHOD = "ui/notifications/size-changed";
|
|
5498
5500
|
var OPEN_LINK_METHOD = "ui/open-link";
|
|
5501
|
+
var OPEN_IMAGE_METHOD = "replicas/open-image";
|
|
5499
5502
|
var VISUAL_CONTENT_HEIGHT_EXPRESSION = "(function(){var r=document.documentElement;return Math.ceil(r.scrollHeight>r.clientHeight?r.scrollHeight:r.getBoundingClientRect().height)})()";
|
|
5500
5503
|
var BASE_CSS = "html{color:var(--foreground);font-family:var(--font-sans);font-size:13px;line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;scrollbar-width:none}html::-webkit-scrollbar{display:none}body{margin:0}:where(*,*::before,*::after){box-sizing:border-box}code,kbd,pre,samp{font-family:var(--font-mono)}:where(:focus-visible){outline:2px solid var(--ring);outline-offset:-2px}";
|
|
5501
5504
|
var THEME_STYLE_ID = "replicas-visual-theme";
|
|
@@ -5533,6 +5536,23 @@ var BOOTSTRAP_SCRIPT = `
|
|
|
5533
5536
|
}, true);
|
|
5534
5537
|
}
|
|
5535
5538
|
if (!framed && !nativeView) return;
|
|
5539
|
+
window.addEventListener('click', (event) => {
|
|
5540
|
+
const image = event.composedPath()[0];
|
|
5541
|
+
if (!event.isTrusted || event.defaultPrevented || !(image instanceof HTMLImageElement) || image.closest('a[href], button')) return;
|
|
5542
|
+
let src = image.currentSrc || image.src;
|
|
5543
|
+
if (/^blob:/i.test(src) || (nativeView && /^data:image\\/svg|\\.svg(?:[?#]|$)/i.test(src))) {
|
|
5544
|
+
try {
|
|
5545
|
+
const canvas = document.createElement('canvas');
|
|
5546
|
+
canvas.width = (image.naturalWidth || image.width) * 2;
|
|
5547
|
+
canvas.height = (image.naturalHeight || image.height) * 2;
|
|
5548
|
+
canvas.getContext('2d').drawImage(image, 0, 0, canvas.width, canvas.height);
|
|
5549
|
+
src = canvas.toDataURL('image/png');
|
|
5550
|
+
} catch {
|
|
5551
|
+
return;
|
|
5552
|
+
}
|
|
5553
|
+
}
|
|
5554
|
+
if (src) post({ jsonrpc: '2.0', method: '${OPEN_IMAGE_METHOD}', params: { src, name: image.alt } });
|
|
5555
|
+
});
|
|
5536
5556
|
let reportedHeight;
|
|
5537
5557
|
const reportHeight = () => {
|
|
5538
5558
|
const height = ${VISUAL_CONTENT_HEIGHT_EXPRESSION};
|
|
@@ -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-BDG3ZBSX.js";
|
|
7
|
+
import "./chunk-KDEQVFNS.js";
|
|
8
|
+
import "./chunk-7KFWEP2H.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-T2AQMKMR.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-HFDKOF2D.js";
|
|
17
17
|
import {
|
|
18
18
|
AppServerProcess,
|
|
19
19
|
buildCodexAgentEnv
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-HHE27FT5.js";
|
|
21
|
+
import "./chunk-7KFWEP2H.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-T2AQMKMR.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-BDG3ZBSX.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-HFDKOF2D.js";
|
|
68
68
|
import {
|
|
69
69
|
publishedPullRequestUrls
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-V6WTK62K.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-EF6KRJ3M.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-KDEQVFNS.js";
|
|
152
152
|
import {
|
|
153
153
|
getCodexModelProvider
|
|
154
|
-
} from "./chunk-
|
|
154
|
+
} from "./chunk-HHE27FT5.js";
|
|
155
155
|
import {
|
|
156
156
|
SUBPROCESS_MAX_BUFFER,
|
|
157
157
|
execAsync,
|
|
158
158
|
execFileAsync
|
|
159
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-7KFWEP2H.js";
|
|
160
160
|
import {
|
|
161
161
|
isRecord as isRecord2
|
|
162
162
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -391,7 +391,7 @@ import {
|
|
|
391
391
|
workspaceTokenRequestSchema,
|
|
392
392
|
workspaceTokenResponseSchema,
|
|
393
393
|
wrapInTag
|
|
394
|
-
} from "./chunk-
|
|
394
|
+
} from "./chunk-T2AQMKMR.js";
|
|
395
395
|
import {
|
|
396
396
|
cloneMcpConfig,
|
|
397
397
|
ensureCompatibilityImports,
|
|
@@ -11066,8 +11066,8 @@ var QUOTA_STOP_NEXT_STEP = {
|
|
|
11066
11066
|
function describeQuotaExhaustion(provider, reason, credential, fallback) {
|
|
11067
11067
|
const agent = getProviderDisplayName(provider);
|
|
11068
11068
|
const account = credential ? describeCredential(provider, credential) : "the credential this workspace is using";
|
|
11069
|
-
const limit = reason === "out_of_credits" ? `${agent} ran out of credits on ${account}.` : `${agent} hit the usage limit on ${account}.`;
|
|
11070
|
-
const next = fallback.outcome === "fork" ? `Continuing in ${getProviderDisplayName(fallback.target.provider, "long")}.` : QUOTA_STOP_NEXT_STEP[fallback.outcome];
|
|
11069
|
+
const limit = reason === "credits_required" ? `The selected model needs usage credits on ${account}.` : reason === "out_of_credits" ? `${agent} ran out of credits on ${account}.` : `${agent} hit the usage limit on ${account}.`;
|
|
11070
|
+
const next = fallback.outcome === "fork" ? `Continuing in ${getProviderDisplayName(fallback.target.provider, "long")}.` : reason === "credits_required" ? "Pick a different model, or turn on usage credits for this account." : QUOTA_STOP_NEXT_STEP[fallback.outcome];
|
|
11071
11071
|
return `${limit} ${next}`;
|
|
11072
11072
|
}
|
|
11073
11073
|
var fallbackLocks = /* @__PURE__ */ new Map();
|
|
@@ -11120,9 +11120,8 @@ var AuthFallbackCoordinator = class {
|
|
|
11120
11120
|
if (!tokenManager || !exhausted) continue;
|
|
11121
11121
|
const swap = await tokenManager.fetchFreshCredentials(
|
|
11122
11122
|
`${this.provider} ${describeQuotaLimit(reason)}: ${detail}`,
|
|
11123
|
-
//
|
|
11124
|
-
|
|
11125
|
-
reason === "auth_failed" ? "rejected" : "exhausted",
|
|
11123
|
+
// Skipped via the exclusion above, not rested, so Settings doesn't show a usage limit.
|
|
11124
|
+
reason === "auth_failed" || reason === "credits_required" ? "rejected" : "exhausted",
|
|
11126
11125
|
exhausted,
|
|
11127
11126
|
step.methods.length > 0 ? step.methods : void 0
|
|
11128
11127
|
);
|
|
@@ -13100,7 +13099,8 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13100
13099
|
attempt++;
|
|
13101
13100
|
continue;
|
|
13102
13101
|
}
|
|
13103
|
-
|
|
13102
|
+
const method = attemptedCredential?.method ?? resolveClaudeAuthMethodForMessage();
|
|
13103
|
+
loginRevoked = (method === "oauth" || method === "unknown") && refreshed.error.message.includes('"code":"oauth_disconnected"');
|
|
13104
13104
|
}
|
|
13105
13105
|
if (quotaKind || isAuthError) {
|
|
13106
13106
|
const reason = quotaKind ?? "auth_failed";
|
|
@@ -13524,15 +13524,17 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13524
13524
|
const iterator = response[Symbol.asyncIterator]();
|
|
13525
13525
|
let loopError = null;
|
|
13526
13526
|
let suppressLinearResponseFlush = false;
|
|
13527
|
+
let creditsRequired = false;
|
|
13527
13528
|
try {
|
|
13528
13529
|
while (true) {
|
|
13529
13530
|
const next = await iterator.next();
|
|
13530
13531
|
if (next.done || this.activeQuery !== response) break;
|
|
13531
13532
|
const msg = next.value;
|
|
13532
13533
|
if (!msg) break;
|
|
13534
|
+
if (msg.type === "rate_limit_event") creditsRequired = msg.rate_limit_info.errorCode === "credits_required";
|
|
13533
13535
|
const authErrorMessage = _ClaudeManager.detectAuthErrorInMessage(msg);
|
|
13534
13536
|
const transientErrorMessage = _ClaudeManager.detectTransientTurnErrorInMessage(msg);
|
|
13535
|
-
const turnError = authErrorMessage ? new ClaudeAuthError(authErrorMessage) : msg.type === "result" && msg.subtype !== "success" && msg.num_turns === 0 && msg.errors.some((err) => err.startsWith("No conversation found with session ID")) ? new ClaudeMissingSessionError(msg.errors.join("\n")) : _ClaudeManager.detectQuotaErrorInMessage(msg) ?? (transientErrorMessage ? new ClaudeTransientTurnError(transientErrorMessage, this.pendingTurn?.sawActivity ?? false) : null);
|
|
13537
|
+
const turnError = authErrorMessage ? new ClaudeAuthError(authErrorMessage) : msg.type === "result" && msg.subtype !== "success" && msg.num_turns === 0 && msg.errors.some((err) => err.startsWith("No conversation found with session ID")) ? new ClaudeMissingSessionError(msg.errors.join("\n")) : _ClaudeManager.detectQuotaErrorInMessage(msg, creditsRequired) ?? (transientErrorMessage ? new ClaudeTransientTurnError(transientErrorMessage, this.pendingTurn?.sawActivity ?? false) : null);
|
|
13536
13538
|
if (turnError) {
|
|
13537
13539
|
suppressLinearResponseFlush = true;
|
|
13538
13540
|
this.failPendingTurn(turnError);
|
|
@@ -13796,17 +13798,17 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13796
13798
|
if (error instanceof ClaudeQuotaError) return error.kind;
|
|
13797
13799
|
return detectAgentQuotaLimit(extractErrorText(error));
|
|
13798
13800
|
}
|
|
13799
|
-
static detectQuotaErrorInMessage(message) {
|
|
13801
|
+
static detectQuotaErrorInMessage(message, creditsRequired) {
|
|
13800
13802
|
if (message.type === "assistant" && "error" in message) {
|
|
13801
13803
|
const content = Array.isArray(message.message?.content) ? message.message.content.map((block) => "text" in block ? block.text : "").join("\n") : "";
|
|
13802
13804
|
const text2 = [typeof message.error === "string" ? message.error : "", content].filter(Boolean).join("\n");
|
|
13803
13805
|
const kind2 = detectAgentQuotaLimit(text2);
|
|
13804
|
-
if (kind2) return new ClaudeQuotaError(text2, kind2);
|
|
13806
|
+
if (kind2) return new ClaudeQuotaError(text2, creditsRequired ? "credits_required" : kind2);
|
|
13805
13807
|
}
|
|
13806
13808
|
if (message.type !== "result" || !message.is_error) return null;
|
|
13807
13809
|
const text = message.subtype === "success" ? message.result : message.errors.join("\n");
|
|
13808
13810
|
const kind = detectAgentQuotaLimit(text);
|
|
13809
|
-
return kind ? new ClaudeQuotaError(text, kind) : null;
|
|
13811
|
+
return kind ? new ClaudeQuotaError(text, creditsRequired ? "credits_required" : kind) : null;
|
|
13810
13812
|
}
|
|
13811
13813
|
static isTransientTurnError(error) {
|
|
13812
13814
|
if (error instanceof ClaudeTransientTurnError) return true;
|
|
@@ -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-V6WTK62K.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-T2AQMKMR.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