replicas-engine 0.1.1700 → 0.1.1702
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-UZCWDFTA.js → asp-host-KCJL4WQV.js} +6 -6
- package/dist/src/{chunk-4IIA4LHK.js → chunk-2KKLN5XH.js} +2 -2
- package/dist/src/{chunk-2Z55GTLE.js → chunk-6CHA3FJO.js} +2 -2
- package/dist/src/{chunk-7KSPT62G.js → chunk-AUVG7KF2.js} +2 -2
- package/dist/src/{chunk-YUTD43BJ.js → chunk-FMZ5SMSR.js} +3 -3
- package/dist/src/{chunk-IO54MNKJ.js → chunk-LYA6URWI.js} +1 -1
- package/dist/src/{chunk-4RBWVNB4.js → chunk-OZDS73OS.js} +1 -1
- package/dist/src/{chunk-GQOYWYVG.js → chunk-PQ5QCBFM.js} +1 -1
- package/dist/src/{chunk-BONRQV3P.js → chunk-QAMDO35I.js} +46 -4
- package/dist/src/{chunk-2UYPE3JQ.js → chunk-TH57XH6R.js} +1 -1
- package/dist/src/{chunk-KF3MD76W.js → chunk-TOSLB2QB.js} +7 -7
- package/dist/src/codemode-mcp.js +3 -3
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +29 -11
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
listCodexModelsForDetails,
|
|
9
9
|
restartCodexAspHost,
|
|
10
10
|
restartCodexAspHostIfRunning
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-TOSLB2QB.js";
|
|
12
|
+
import "./chunk-TH57XH6R.js";
|
|
13
|
+
import "./chunk-2KKLN5XH.js";
|
|
14
|
+
import "./chunk-FMZ5SMSR.js";
|
|
15
|
+
import "./chunk-OZDS73OS.js";
|
|
16
16
|
import "./chunk-UZSNFLDQ.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-QAMDO35I.js";
|
|
18
18
|
import "./chunk-VEQXQN22.js";
|
|
19
19
|
export {
|
|
20
20
|
CODEX_ULTRAFAST_SERVICE_TIER,
|
|
@@ -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-OZDS73OS.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord
|
|
10
10
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
provisionedDeviceSchema,
|
|
22
22
|
readReplicasRuntimeEnv,
|
|
23
23
|
serializePosixEnvFile
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-QAMDO35I.js";
|
|
25
25
|
|
|
26
26
|
// src/runtime-env-loader.ts
|
|
27
27
|
import { readFileSync } from "fs";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
ENGINE_ENV,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
runGitCommand
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2KKLN5XH.js";
|
|
9
9
|
import {
|
|
10
10
|
COMMAND_PROTECTION_MAX_MESSAGE_FILE_BYTES,
|
|
11
11
|
COMMAND_PROTECTION_REPO_GIT_ARGS,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
parseCommandProtectionRequest,
|
|
19
19
|
toCommandProtectionRepoState,
|
|
20
20
|
withRetry
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-QAMDO35I.js";
|
|
22
22
|
|
|
23
23
|
// src/services/command-protection-service.ts
|
|
24
24
|
import { readFile, stat } from "fs/promises";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-7ZDAVYTV.js";
|
|
7
7
|
import {
|
|
8
8
|
AspClient
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FMZ5SMSR.js";
|
|
10
10
|
import {
|
|
11
11
|
ASTER_BASE_URL,
|
|
12
12
|
ASTER_PROVIDER,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
isRecord,
|
|
19
19
|
readOllamaAuthEnv,
|
|
20
20
|
readOpenAICompatibleAuthEnv
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-QAMDO35I.js";
|
|
22
22
|
|
|
23
23
|
// src/managers/codex-asp/notification-dispatch.ts
|
|
24
24
|
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-OZDS73OS.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QAMDO35I.js";
|
|
10
10
|
|
|
11
11
|
// src/utils/codex-agent-env.ts
|
|
12
12
|
function buildCodexAgentEnv(source = process.env) {
|
|
@@ -244,7 +244,7 @@ function getCodexModelProvider(method) {
|
|
|
244
244
|
if (method === "foundry") return "azure";
|
|
245
245
|
return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
|
|
246
246
|
}
|
|
247
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
247
|
+
var ENGINE_PACKAGE_VERSION = "0.1.1702";
|
|
248
248
|
var INITIALIZE_METHOD = "initialize";
|
|
249
249
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
250
250
|
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-
|
|
6
|
+
} from "./chunk-QAMDO35I.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -12556,9 +12556,16 @@ function getChatThreadSources(chats, chat) {
|
|
|
12556
12556
|
|
|
12557
12557
|
// ../shared/src/credential-refresh.ts
|
|
12558
12558
|
import { z as z20 } from "zod";
|
|
12559
|
+
var restingCredentialsSchema = z20.object({
|
|
12560
|
+
count: z20.number(),
|
|
12561
|
+
/** Set when every one of them is in this scope. */
|
|
12562
|
+
scope: z20.enum(CREDENTIAL_SCOPE).optional(),
|
|
12563
|
+
resetsAt: z20.string()
|
|
12564
|
+
});
|
|
12559
12565
|
var engineCredentialRefreshFailureSchema = z20.object({
|
|
12560
12566
|
code: z20.string(),
|
|
12561
|
-
credential: workspaceCredentialSelectionSchema.optional()
|
|
12567
|
+
credential: workspaceCredentialSelectionSchema.optional(),
|
|
12568
|
+
resting: restingCredentialsSchema.optional()
|
|
12562
12569
|
});
|
|
12563
12570
|
|
|
12564
12571
|
// ../shared/src/credential-pool.ts
|
|
@@ -13508,7 +13515,7 @@ var computeTransferPathSchema = z23.object({
|
|
|
13508
13515
|
// ../shared/src/default-skills/replicas-agent/abilities/gpu.ts
|
|
13509
13516
|
var COMPUTE_SANDBOX_WORKDIR = COMPUTE_SANDBOX_WORKDIRS.gpu;
|
|
13510
13517
|
var SECTION6 = `### GPU sandboxes
|
|
13511
|
-
Run GPU workloads (training, inference, CUDA builds, rendering) on cloud GPU sandboxes with \`replicas gpu\`. The workspace itself has no GPU.
|
|
13518
|
+
Run GPU workloads (training, inference, CUDA builds, rendering) on cloud GPU sandboxes with \`replicas gpu\`. The workspace itself has no GPU, but GPU sandboxes are available when a task needs one.
|
|
13512
13519
|
|
|
13513
13520
|
**Reference:** \`references/GPU.md\`
|
|
13514
13521
|
|
|
@@ -13546,6 +13553,41 @@ replicas gpu delete
|
|
|
13546
13553
|
- \`--port 8000\` on create exposes a container port as a public HTTPS URL (shown by \`list\`).
|
|
13547
13554
|
- \`--env KEY=value\` passes secrets such as \`HF_TOKEN\`; never bake them into files you push.
|
|
13548
13555
|
|
|
13556
|
+
## GPU-accelerated browser
|
|
13557
|
+
|
|
13558
|
+
The workspace's browser renders WebGL in software. Chrome in a GPU sandbox also uses software rendering unless it gets the flags below. If you need a page rendered on a real GPU, push a production build and serve it inside the sandbox. The sandbox carries no Replicas login, so it can only open a preview URL (\`references/PREVIEWS.md\`) created without \`--authenticated\`, which anyone with the link can open: ask the user before making a private app public that way, and never recreate an existing authenticated preview without the flag. Then run Playwright in a GPU sandbox:
|
|
13559
|
+
|
|
13560
|
+
\`\`\`bash
|
|
13561
|
+
mkdir -p /tmp/gpu-browser && cd /tmp/gpu-browser
|
|
13562
|
+
cat > fps.mjs <<'EOF'
|
|
13563
|
+
import { chromium } from 'playwright';
|
|
13564
|
+
import { mkdirSync } from 'node:fs';
|
|
13565
|
+
// Without these flags Chrome falls back to SwiftShader, a software renderer.
|
|
13566
|
+
const browser = await chromium.launch({ args: ['--use-angle=vulkan', '--enable-features=Vulkan', '--ignore-gpu-blocklist'] });
|
|
13567
|
+
const page = await browser.newPage({ viewport: { width: 1280, height: 720 } });
|
|
13568
|
+
await page.goto(process.argv[2], { waitUntil: 'networkidle' });
|
|
13569
|
+
const result = await page.evaluate(async () => {
|
|
13570
|
+
const gl = document.createElement('canvas').getContext('webgl');
|
|
13571
|
+
const info = gl?.getExtension('WEBGL_debug_renderer_info');
|
|
13572
|
+
const renderer = info ? gl.getParameter(info.UNMASKED_RENDERER_WEBGL) : 'no WebGL';
|
|
13573
|
+
const frames = [];
|
|
13574
|
+
await new Promise((done) => {
|
|
13575
|
+
const tick = (t) => { frames.push(t); frames.at(-1) - frames[0] < 5000 ? requestAnimationFrame(tick) : done(); };
|
|
13576
|
+
requestAnimationFrame(tick);
|
|
13577
|
+
});
|
|
13578
|
+
const gaps = frames.slice(1).map((t, i) => t - frames[i]).sort((a, b) => a - b);
|
|
13579
|
+
return { renderer, fps: Math.round((frames.length - 1) / 5), p95FrameMs: Math.round(gaps[Math.floor(gaps.length * 0.95)]) };
|
|
13580
|
+
});
|
|
13581
|
+
console.log(JSON.stringify(result));
|
|
13582
|
+
mkdirSync('outputs', { recursive: true });
|
|
13583
|
+
await page.screenshot({ path: 'outputs/frame.png' });
|
|
13584
|
+
await browser.close();
|
|
13585
|
+
EOF
|
|
13586
|
+
replicas gpu run --image mcr.microsoft.com/playwright:v1.49.0-noble --pull outputs -- "npm i playwright@1.49.0 >/dev/null && node fps.mjs https://<preview-url>/<page>"
|
|
13587
|
+
\`\`\`
|
|
13588
|
+
|
|
13589
|
+
Check that \`renderer\` names the NVIDIA GPU; one naming SwiftShader means the page ran in software. \`fps\` counts the browser's frame callbacks, which is the most the page can draw; a game that skips frames draws fewer, so read its own frame counter (or count calls to its render function) when it has one. Add the interactions the page needs (clicks, waits for a scene to load) before measuring, and keep the Playwright package version matching the image tag.
|
|
13590
|
+
|
|
13549
13591
|
## Choosing hardware and images
|
|
13550
13592
|
|
|
13551
13593
|
- GPUs, picked with \`--gpu\`: ${GPU_TYPES.join(", ")} (default ${DEFAULT_GPU_TYPE}). Add a count for multi-GPU, e.g. \`H100:4\` (max ${COMPUTE_SANDBOX_LIMITS.maxGpuCount}). Pick the smallest GPU that fits: T4/L4 for small models and smoke tests, A100/H100 for real training.
|
|
@@ -13562,7 +13604,7 @@ replicas gpu delete
|
|
|
13562
13604
|
var GPU_ABILITY = {
|
|
13563
13605
|
label: "GPU sandboxes",
|
|
13564
13606
|
description: "Run training, inference, and other GPU workloads on cloud GPUs with `replicas gpu`.",
|
|
13565
|
-
bullet: "- Running GPU workloads (training, inference, CUDA, rendering) on cloud GPU sandboxes with `replicas gpu`",
|
|
13607
|
+
bullet: "- Running GPU workloads (training, inference, CUDA, rendering) on cloud GPU sandboxes with `replicas gpu` (this workspace has no GPU of its own)",
|
|
13566
13608
|
section: SECTION6,
|
|
13567
13609
|
referenceFile: { name: "GPU.md", content: REFERENCE6 }
|
|
13568
13610
|
};
|
|
@@ -21656,7 +21698,7 @@ async function withRetry(label, fn, options) {
|
|
|
21656
21698
|
}
|
|
21657
21699
|
|
|
21658
21700
|
// ../shared/src/tensorlake.ts
|
|
21659
|
-
var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-20-
|
|
21701
|
+
var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-20-v60";
|
|
21660
21702
|
var TENSORLAKE_DISK_MB = 100 * 1024;
|
|
21661
21703
|
|
|
21662
21704
|
// ../shared/src/egress.ts
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
SUBAGENT_MCP_TOOL_NAMES
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QAMDO35I.js";
|
|
7
7
|
|
|
8
8
|
// src/managers/subagent-mcp-config.ts
|
|
9
9
|
import { existsSync } 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
|
subagentCodexMcpConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TH57XH6R.js";
|
|
7
7
|
import {
|
|
8
8
|
ENGINE_ENV,
|
|
9
9
|
UNQUOTED_PATHS_CONFIG,
|
|
@@ -15,15 +15,15 @@ import {
|
|
|
15
15
|
resolveDiffBase,
|
|
16
16
|
runGitCommand,
|
|
17
17
|
setAgentCredentialSnapshot
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-2KKLN5XH.js";
|
|
19
19
|
import {
|
|
20
20
|
AppServerProcess,
|
|
21
21
|
buildCodexAgentEnv
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-FMZ5SMSR.js";
|
|
23
23
|
import {
|
|
24
24
|
SUBPROCESS_MAX_BUFFER,
|
|
25
25
|
execFileAsync
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-OZDS73OS.js";
|
|
27
27
|
import {
|
|
28
28
|
isRecord
|
|
29
29
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
shrunkImageSize,
|
|
64
64
|
splitManagerInstructions,
|
|
65
65
|
withTimeout
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-QAMDO35I.js";
|
|
67
67
|
|
|
68
68
|
// src/managers/codex-token-manager.ts
|
|
69
69
|
import { promises as fs } from "fs";
|
|
@@ -463,7 +463,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
463
463
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
464
464
|
await this.applyCredentialsResponse(data);
|
|
465
465
|
setAgentCredentialSnapshot("codex", data);
|
|
466
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
466
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-KCJL4WQV.js");
|
|
467
467
|
await restartCodexAspHostIfRunning2();
|
|
468
468
|
});
|
|
469
469
|
await this.start(true);
|
|
@@ -485,7 +485,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
485
485
|
const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
|
|
486
486
|
await this.applyCredentialsResponse(data);
|
|
487
487
|
if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
|
|
488
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
488
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-KCJL4WQV.js");
|
|
489
489
|
await restartCodexAspHostIfRunning2();
|
|
490
490
|
}
|
|
491
491
|
setAgentCredentialSnapshot("codex", data);
|
package/dist/src/codemode-mcp.js
CHANGED
|
@@ -4,15 +4,15 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
getManagedPiMcpServers,
|
|
6
6
|
managedMcpServerProcess
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LYA6URWI.js";
|
|
8
8
|
import "./chunk-7ZDAVYTV.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-TH57XH6R.js";
|
|
10
10
|
import {
|
|
11
11
|
isRecord
|
|
12
12
|
} from "./chunk-UZSNFLDQ.js";
|
|
13
13
|
import {
|
|
14
14
|
rankToolsByQuery
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QAMDO35I.js";
|
|
16
16
|
import "./chunk-VEQXQN22.js";
|
|
17
17
|
|
|
18
18
|
// src/codemode-mcp.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-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-6CHA3FJO.js";
|
|
7
|
+
import "./chunk-2KKLN5XH.js";
|
|
8
|
+
import "./chunk-OZDS73OS.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-QAMDO35I.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/command-protection-hook.ts
|
|
@@ -14,13 +14,13 @@ import {
|
|
|
14
14
|
recoverCompletedTurn,
|
|
15
15
|
spawnMuseMsp,
|
|
16
16
|
startMuseSession
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AUVG7KF2.js";
|
|
18
18
|
import "./chunk-7ZDAVYTV.js";
|
|
19
19
|
import {
|
|
20
20
|
AppServerProcess,
|
|
21
21
|
buildCodexAgentEnv
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-FMZ5SMSR.js";
|
|
23
|
+
import "./chunk-OZDS73OS.js";
|
|
24
24
|
import {
|
|
25
25
|
AGENT,
|
|
26
26
|
OPENCODE_GO_PROVIDER,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
headlessAgentUsagePath,
|
|
31
31
|
isRecord,
|
|
32
32
|
withTimeout
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-QAMDO35I.js";
|
|
34
34
|
import "./chunk-VEQXQN22.js";
|
|
35
35
|
|
|
36
36
|
// src/headless-agent.ts
|
package/dist/src/index.js
CHANGED
|
@@ -90,12 +90,12 @@ import {
|
|
|
90
90
|
import {
|
|
91
91
|
getManagedPiMcpServers,
|
|
92
92
|
managedMcpServerProcess
|
|
93
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-LYA6URWI.js";
|
|
94
94
|
import {
|
|
95
95
|
evaluateCommandProtection,
|
|
96
96
|
extractToolCommand,
|
|
97
97
|
reportCommandProtectionBlock
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-6CHA3FJO.js";
|
|
99
99
|
import {
|
|
100
100
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
101
101
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
spawnMuseMsp,
|
|
130
130
|
startMuseSession,
|
|
131
131
|
uuidV7
|
|
132
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-AUVG7KF2.js";
|
|
133
133
|
import {
|
|
134
134
|
MUSE_AUTH_PATH,
|
|
135
135
|
OPENCODE_AUTH_PATH,
|
|
@@ -137,7 +137,7 @@ import {
|
|
|
137
137
|
} from "./chunk-7ZDAVYTV.js";
|
|
138
138
|
import {
|
|
139
139
|
publishedPullRequestUrls
|
|
140
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-PQ5QCBFM.js";
|
|
141
141
|
import {
|
|
142
142
|
ACCOUNT_RATE_LIMITS_READ_METHOD,
|
|
143
143
|
AsyncLock,
|
|
@@ -215,12 +215,12 @@ import {
|
|
|
215
215
|
transcriptSecrets,
|
|
216
216
|
upsertCredentialFileLines,
|
|
217
217
|
writeSecureCredentialFile
|
|
218
|
-
} from "./chunk-
|
|
218
|
+
} from "./chunk-TOSLB2QB.js";
|
|
219
219
|
import {
|
|
220
220
|
SUBAGENT_MCP_TOOL_TIMEOUT_MS,
|
|
221
221
|
engineScriptProcess,
|
|
222
222
|
subagentMcpProcessConfig
|
|
223
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-TH57XH6R.js";
|
|
224
224
|
import {
|
|
225
225
|
ENGINE_ENV,
|
|
226
226
|
UNQUOTED_PATHS_CONFIG,
|
|
@@ -231,18 +231,18 @@ import {
|
|
|
231
231
|
resolveDiffBase,
|
|
232
232
|
setAgentCredentialSnapshot,
|
|
233
233
|
setLinearSessionId
|
|
234
|
-
} from "./chunk-
|
|
234
|
+
} from "./chunk-2KKLN5XH.js";
|
|
235
235
|
import {
|
|
236
236
|
AspRequestTimeoutError,
|
|
237
237
|
AspResponseError,
|
|
238
238
|
buildCodexAgentEnv,
|
|
239
239
|
getCodexModelProvider
|
|
240
|
-
} from "./chunk-
|
|
240
|
+
} from "./chunk-FMZ5SMSR.js";
|
|
241
241
|
import {
|
|
242
242
|
SUBPROCESS_MAX_BUFFER,
|
|
243
243
|
execAsync,
|
|
244
244
|
execFileAsync
|
|
245
|
-
} from "./chunk-
|
|
245
|
+
} from "./chunk-OZDS73OS.js";
|
|
246
246
|
import {
|
|
247
247
|
isRecord
|
|
248
248
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -543,7 +543,7 @@ import {
|
|
|
543
543
|
workspaceTokenRequestSchema,
|
|
544
544
|
workspaceTokenResponseSchema,
|
|
545
545
|
wrapInTag
|
|
546
|
-
} from "./chunk-
|
|
546
|
+
} from "./chunk-QAMDO35I.js";
|
|
547
547
|
import {
|
|
548
548
|
__commonJS,
|
|
549
549
|
__export,
|
|
@@ -11366,6 +11366,9 @@ function canSteerMessage(provider, request) {
|
|
|
11366
11366
|
import { existsSync as existsSync5 } from "fs";
|
|
11367
11367
|
import { join as join9 } from "path";
|
|
11368
11368
|
|
|
11369
|
+
// ../shared/src/routes/subscription-usage.ts
|
|
11370
|
+
var formatUsageTime = (iso3, options) => new Date(iso3).toLocaleString(void 0, { hour: "numeric", minute: "2-digit", ...options });
|
|
11371
|
+
|
|
11369
11372
|
// src/managers/muse-token-manager.ts
|
|
11370
11373
|
var MuseTokenManager = class extends BaseRefreshManager {
|
|
11371
11374
|
constructor() {
|
|
@@ -11462,6 +11465,12 @@ function describeQuotaExhaustion(provider, reason, credential, fallback) {
|
|
|
11462
11465
|
const agent = getProviderDisplayName(provider);
|
|
11463
11466
|
const account = credential ? describeCredential(provider, credential) : "the credential this workspace is using";
|
|
11464
11467
|
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}.`;
|
|
11468
|
+
const resting = fallback.outcome === "not_configured" && reason === "rate_limit" ? fallback.resting : void 0;
|
|
11469
|
+
if (resting && resting.count > 1) {
|
|
11470
|
+
const owner = resting.scope === CREDENTIAL_SCOPE.ORG ? "the organization's" : resting.scope === CREDENTIAL_SCOPE.USER ? "the personal" : "the";
|
|
11471
|
+
const retryAt = formatUsageTime(resting.resetsAt, { month: "short", day: "numeric", timeZone: "UTC", timeZoneName: "short" });
|
|
11472
|
+
return `${limit} All ${resting.count} of ${owner} ${agent} credentials in the fallback chain are at their usage limit, and Replicas can use the first of them again ${retryAt}. Add a credential or harness in Settings \u2192 Fallbacks, or try again then.`;
|
|
11473
|
+
}
|
|
11465
11474
|
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];
|
|
11466
11475
|
return `${limit} ${next}`;
|
|
11467
11476
|
}
|
|
@@ -11522,6 +11531,7 @@ var AuthFallbackCoordinator = class {
|
|
|
11522
11531
|
}
|
|
11523
11532
|
const steps = plan.ok ? plan.data.steps : tokenManager && exhausted ? [{ kind: "credentials", methods: [] }] : [];
|
|
11524
11533
|
let failed = false;
|
|
11534
|
+
let resting;
|
|
11525
11535
|
for (const step of steps) {
|
|
11526
11536
|
if (step.kind === "harness") {
|
|
11527
11537
|
if (!forkable || !isAgentAvailable(step.provider)) continue;
|
|
@@ -11543,6 +11553,14 @@ var AuthFallbackCoordinator = class {
|
|
|
11543
11553
|
);
|
|
11544
11554
|
if (!swap.ok) {
|
|
11545
11555
|
failed ||= swap.error.code !== "no_credentials";
|
|
11556
|
+
const skipped = engineCredentialRefreshFailureSchema.safeParse(extractJsonObject(swap.error.message)).data?.resting;
|
|
11557
|
+
if (skipped) {
|
|
11558
|
+
resting = resting ? {
|
|
11559
|
+
count: resting.count + skipped.count,
|
|
11560
|
+
...resting.scope === skipped.scope ? { scope: skipped.scope } : {},
|
|
11561
|
+
resetsAt: resting.resetsAt < skipped.resetsAt ? resting.resetsAt : skipped.resetsAt
|
|
11562
|
+
} : skipped;
|
|
11563
|
+
}
|
|
11546
11564
|
continue;
|
|
11547
11565
|
}
|
|
11548
11566
|
const applied = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS[this.provider] ?? exhausted;
|
|
@@ -11553,7 +11571,7 @@ var AuthFallbackCoordinator = class {
|
|
|
11553
11571
|
return this.switched(reason, exhausted, applied, step, detail);
|
|
11554
11572
|
}
|
|
11555
11573
|
if (!tokenManager || !exhausted) return { outcome: "unavailable" };
|
|
11556
|
-
if (!failed) return { outcome: "not_configured" };
|
|
11574
|
+
if (!failed) return { outcome: "not_configured", ...resting ? { resting } : {} };
|
|
11557
11575
|
this.recordNotice(reason, exhausted, exhausted, "failed", "Replicas could not load an alternate credential.");
|
|
11558
11576
|
return { outcome: "failed" };
|
|
11559
11577
|
}
|
|
@@ -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-PQ5QCBFM.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-QAMDO35I.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