replicas-engine 0.1.1722 → 0.1.1725
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-VHAAGTZW.js → asp-host-7DGBCD52.js} +6 -6
- package/dist/src/{chunk-V6RDMCB7.js → chunk-3SJP6X3P.js} +8 -8
- package/dist/src/{chunk-SFJUVEHO.js → chunk-4YQ4UWFY.js} +2 -2
- package/dist/src/{chunk-AHJEBSQV.js → chunk-APCSKPLU.js} +1 -1
- package/dist/src/{chunk-ZXUGUSB7.js → chunk-DHAQM6LA.js} +1 -1
- package/dist/src/{chunk-YUOAXEDM.js → chunk-ESENYL7M.js} +1 -1
- package/dist/src/{chunk-75LHA6I6.js → chunk-EZWCNWX2.js} +2 -2
- package/dist/src/{chunk-TVPCAVPR.js → chunk-LIXZEE44.js} +3 -3
- package/dist/src/{chunk-M656E2I6.js → chunk-UDR2HT74.js} +1 -1
- package/dist/src/{chunk-R7FKDCHE.js → chunk-YNHFXBHT.js} +3 -13
- package/dist/src/{chunk-DR7RF3CO.js → chunk-ZYRAETMX.js} +2 -2
- 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 +26 -244
- 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-3SJP6X3P.js";
|
|
12
|
+
import "./chunk-DHAQM6LA.js";
|
|
13
|
+
import "./chunk-ZYRAETMX.js";
|
|
14
|
+
import "./chunk-LIXZEE44.js";
|
|
15
|
+
import "./chunk-APCSKPLU.js";
|
|
16
16
|
import "./chunk-UZSNFLDQ.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-YNHFXBHT.js";
|
|
18
18
|
import "./chunk-VEQXQN22.js";
|
|
19
19
|
export {
|
|
20
20
|
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
|
subagentCodexMcpConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DHAQM6LA.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-ZYRAETMX.js";
|
|
19
19
|
import {
|
|
20
20
|
AppServerProcess,
|
|
21
21
|
buildCodexAgentEnv
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-LIXZEE44.js";
|
|
23
23
|
import {
|
|
24
24
|
SUBPROCESS_MAX_BUFFER,
|
|
25
25
|
execFileAsync
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-APCSKPLU.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-YNHFXBHT.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-7DGBCD52.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-7DGBCD52.js");
|
|
489
489
|
await restartCodexAspHostIfRunning2();
|
|
490
490
|
}
|
|
491
491
|
setAgentCredentialSnapshot("codex", data);
|
|
@@ -2052,7 +2052,7 @@ async function buildTurnStartParams(threadId, request, serviceTier, unreadReques
|
|
|
2052
2052
|
...codexApprovalPolicyOverrides(),
|
|
2053
2053
|
...effort ? { effort } : {},
|
|
2054
2054
|
collaborationMode: {
|
|
2055
|
-
mode:
|
|
2055
|
+
mode: "default",
|
|
2056
2056
|
settings: {
|
|
2057
2057
|
model,
|
|
2058
2058
|
reasoning_effort: effort ?? null,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-7ZDAVYTV.js";
|
|
7
7
|
import {
|
|
8
8
|
AspClient
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LIXZEE44.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-YNHFXBHT.js";
|
|
22
22
|
|
|
23
23
|
// src/managers/codex-asp/notification-dispatch.ts
|
|
24
24
|
var TURN_STARTED_METHOD = "turn/started";
|
|
@@ -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-YNHFXBHT.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -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-YNHFXBHT.js";
|
|
7
7
|
|
|
8
8
|
// src/managers/subagent-mcp-config.ts
|
|
9
9
|
import { existsSync } from "fs";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
ENGINE_ENV,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
runGitCommand
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZYRAETMX.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-YNHFXBHT.js";
|
|
22
22
|
|
|
23
23
|
// src/services/command-protection-service.ts
|
|
24
24
|
import { readFile, stat } from "fs/promises";
|
|
@@ -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-APCSKPLU.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YNHFXBHT.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.1725";
|
|
248
248
|
var INITIALIZE_METHOD = "initialize";
|
|
249
249
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
250
250
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -9686,8 +9686,7 @@ var managerSubagentSettingsSchema = z4.object({
|
|
|
9686
9686
|
model: z4.string().nullable(),
|
|
9687
9687
|
thinking_level: z4.enum(VALID_THINKING_LEVELS).nullable(),
|
|
9688
9688
|
service_tier: z4.enum(SUBAGENT_SERVICE_TIERS),
|
|
9689
|
-
goal_mode: z4.boolean()
|
|
9690
|
-
plan_mode: z4.boolean()
|
|
9689
|
+
goal_mode: z4.boolean()
|
|
9691
9690
|
});
|
|
9692
9691
|
var QUEUE_SECTIONS = [
|
|
9693
9692
|
{ label: "Open PRs", groups: ["needs_you", "ready_to_merge", "ready_to_review"] },
|
|
@@ -11260,7 +11259,6 @@ var sendChatMessageRequestSchema = z9.object({
|
|
|
11260
11259
|
provider: z9.enum(ENGINE_AGENT_PROVIDERS).optional(),
|
|
11261
11260
|
model: z9.string().optional(),
|
|
11262
11261
|
customInstructions: z9.string().optional(),
|
|
11263
|
-
planMode: z9.boolean().optional(),
|
|
11264
11262
|
images: z9.array(z9.object({
|
|
11265
11263
|
type: z9.literal("image"),
|
|
11266
11264
|
source: z9.discriminatedUnion("type", [
|
|
@@ -16266,7 +16264,6 @@ var automationToolInputSchema = z28.object({
|
|
|
16266
16264
|
`One or more triggers. Cron: \`{ "type": "cron", "config": { "schedule": "0 9 * * 1", "timezone": "America/New_York" } }\`. GitHub: \`{ "type": "github", "config": { "event": "pull_request.opened", "repository_ids": ["<repository uuid>"] } }\`. Linear: \`{ "type": "linear", "config": { "event": "${LINEAR_ISSUE_STATE_CHANGED_EVENT}", "state_types": ["completed"] } }\`.`
|
|
16267
16265
|
),
|
|
16268
16266
|
description: z28.string().optional().describe("One-line summary shown in the dashboard."),
|
|
16269
|
-
plan_mode: z28.boolean().optional(),
|
|
16270
16267
|
goal_mode: z28.boolean().optional(),
|
|
16271
16268
|
fast_mode: z28.boolean().optional(),
|
|
16272
16269
|
workspace_lifecycle_policy: z28.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
|
|
@@ -21809,7 +21806,7 @@ async function withRetry(label, fn, options) {
|
|
|
21809
21806
|
}
|
|
21810
21807
|
|
|
21811
21808
|
// ../shared/src/tensorlake.ts
|
|
21812
|
-
var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-21-
|
|
21809
|
+
var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-21-v20";
|
|
21813
21810
|
var TENSORLAKE_DISK_MB = 100 * 1024;
|
|
21814
21811
|
|
|
21815
21812
|
// ../shared/src/egress.ts
|
|
@@ -21931,12 +21928,6 @@ function createProviderSlashCommand(provider2, name, description2, argumentHint)
|
|
|
21931
21928
|
}
|
|
21932
21929
|
var SIDE_CHAT_COMMANDS = ["/btw", "/side"];
|
|
21933
21930
|
var SLASH_COMMANDS = [
|
|
21934
|
-
{
|
|
21935
|
-
command: "/plan",
|
|
21936
|
-
description: "Switch to plan mode and optionally send a prompt.",
|
|
21937
|
-
argumentHint: "[prompt]",
|
|
21938
|
-
providers: ["claude", "codex", "cursor", "muse", "opencode", "pi"]
|
|
21939
|
-
},
|
|
21940
21931
|
{
|
|
21941
21932
|
command: "/fast",
|
|
21942
21933
|
description: "Use the fast service tier for future turns.",
|
|
@@ -22097,7 +22088,6 @@ var KEYBOARD_SHORTCUTS = {
|
|
|
22097
22088
|
send: { label: "Send", group: "Composer", keys: { key: "Enter" }, fixed: true },
|
|
22098
22089
|
sendAlternate: { label: "Queue or steer instead", group: "Composer", keys: { key: "Enter", alt: true }, fixed: true },
|
|
22099
22090
|
newLine: { label: "New line", group: "Composer", keys: { key: "Enter", shift: true }, fixed: true },
|
|
22100
|
-
toggleTaskMode: { label: "Switch Plan / Build", group: "Composer", keys: { key: "Tab", shift: true } },
|
|
22101
22091
|
toggleVoiceInput: { label: "Voice input", group: "Composer", keys: { key: " ", mod: true, shift: true } },
|
|
22102
22092
|
previousPrompt: { label: "Previous prompt", group: "Composer", keys: { key: "ArrowUp" }, fixed: true },
|
|
22103
22093
|
searchPromptHistory: { label: "Search prompt history", group: "Composer", keys: { key: "r", ctrl: true } },
|
|
@@ -22499,7 +22489,7 @@ var harnessWorkerCredentialResponseSchema = z35.discriminatedUnion("method", [
|
|
|
22499
22489
|
/** Run the call on our own key, which the worker reads from its environment; it's billed to the organization at cost. */
|
|
22500
22490
|
z35.object({ method: z35.literal("replicas") })
|
|
22501
22491
|
]);
|
|
22502
|
-
var
|
|
22492
|
+
var harnessWorkerAccessResponseSchema = z35.object({ allowed: z35.boolean() });
|
|
22503
22493
|
var harnessWorkerTurnCompleteRequestSchema = z35.object({ errors: z35.array(z35.string()) });
|
|
22504
22494
|
|
|
22505
22495
|
// ../shared/src/auth-errors.ts
|
|
@@ -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-APCSKPLU.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-YNHFXBHT.js";
|
|
25
25
|
|
|
26
26
|
// src/runtime-env-loader.ts
|
|
27
27
|
import { readFileSync } from "fs";
|
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-UDR2HT74.js";
|
|
8
8
|
import "./chunk-7ZDAVYTV.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-DHAQM6LA.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-YNHFXBHT.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-EZWCNWX2.js";
|
|
7
|
+
import "./chunk-ZYRAETMX.js";
|
|
8
|
+
import "./chunk-APCSKPLU.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-YNHFXBHT.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-4YQ4UWFY.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-LIXZEE44.js";
|
|
23
|
+
import "./chunk-APCSKPLU.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-YNHFXBHT.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-UDR2HT74.js";
|
|
94
94
|
import {
|
|
95
95
|
evaluateCommandProtection,
|
|
96
96
|
extractToolCommand,
|
|
97
97
|
reportCommandProtectionBlock
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-EZWCNWX2.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-4YQ4UWFY.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-ESENYL7M.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-3SJP6X3P.js";
|
|
219
219
|
import {
|
|
220
220
|
SUBAGENT_MCP_TOOL_TIMEOUT_MS,
|
|
221
221
|
engineScriptProcess,
|
|
222
222
|
subagentMcpProcessConfig
|
|
223
|
-
} from "./chunk-
|
|
223
|
+
} from "./chunk-DHAQM6LA.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-ZYRAETMX.js";
|
|
235
235
|
import {
|
|
236
236
|
AspRequestTimeoutError,
|
|
237
237
|
AspResponseError,
|
|
238
238
|
buildCodexAgentEnv,
|
|
239
239
|
getCodexModelProvider
|
|
240
|
-
} from "./chunk-
|
|
240
|
+
} from "./chunk-LIXZEE44.js";
|
|
241
241
|
import {
|
|
242
242
|
SUBPROCESS_MAX_BUFFER,
|
|
243
243
|
execAsync,
|
|
244
244
|
execFileAsync
|
|
245
|
-
} from "./chunk-
|
|
245
|
+
} from "./chunk-APCSKPLU.js";
|
|
246
246
|
import {
|
|
247
247
|
isRecord
|
|
248
248
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -353,7 +353,6 @@ import {
|
|
|
353
353
|
SUBAGENT_MCP_HARNESSES,
|
|
354
354
|
SUBAGENT_MCP_SERVER_NAME,
|
|
355
355
|
SUBAGENT_MCP_TOOLS,
|
|
356
|
-
SUBAGENT_MCP_TOOL_NAMES,
|
|
357
356
|
TENSORLAKE_IMAGE_NAME,
|
|
358
357
|
TERMINAL_RTC_ICE_SERVER,
|
|
359
358
|
TIMEOUT,
|
|
@@ -543,7 +542,7 @@ import {
|
|
|
543
542
|
workspaceTokenRequestSchema,
|
|
544
543
|
workspaceTokenResponseSchema,
|
|
545
544
|
wrapInTag
|
|
546
|
-
} from "./chunk-
|
|
545
|
+
} from "./chunk-YNHFXBHT.js";
|
|
547
546
|
import {
|
|
548
547
|
__commonJS,
|
|
549
548
|
__export,
|
|
@@ -13411,32 +13410,10 @@ var PromptStream = class {
|
|
|
13411
13410
|
};
|
|
13412
13411
|
}
|
|
13413
13412
|
};
|
|
13414
|
-
var ALWAYS_ALLOWED_TOOLS = [
|
|
13415
|
-
"Read",
|
|
13416
|
-
"Glob",
|
|
13417
|
-
"Grep",
|
|
13418
|
-
"WebSearch",
|
|
13419
|
-
"WebFetch",
|
|
13420
|
-
"TaskCreate",
|
|
13421
|
-
"TaskUpdate",
|
|
13422
|
-
"TaskGet",
|
|
13423
|
-
"TaskList",
|
|
13424
|
-
"Agent",
|
|
13425
|
-
"ListMcpResourcesTool",
|
|
13426
|
-
"ReadMcpResourceTool",
|
|
13427
|
-
"Skill",
|
|
13428
|
-
"ToolSearch",
|
|
13429
|
-
"Bash",
|
|
13430
|
-
"Monitor",
|
|
13431
|
-
"Write",
|
|
13432
|
-
"Edit",
|
|
13433
|
-
"NotebookEdit",
|
|
13434
|
-
"TaskOutput",
|
|
13435
|
-
"TaskStop",
|
|
13436
|
-
"ScheduleWakeup"
|
|
13437
|
-
];
|
|
13438
13413
|
var ALWAYS_DISALLOWED_TOOLS = [
|
|
13414
|
+
"AskUserQuestion",
|
|
13439
13415
|
"EnterPlanMode",
|
|
13416
|
+
"ExitPlanMode",
|
|
13440
13417
|
"EnterWorktree",
|
|
13441
13418
|
"ExitWorktree",
|
|
13442
13419
|
"CronCreate",
|
|
@@ -13445,7 +13422,6 @@ var ALWAYS_DISALLOWED_TOOLS = [
|
|
|
13445
13422
|
"RemoteTrigger",
|
|
13446
13423
|
"PushNotification"
|
|
13447
13424
|
];
|
|
13448
|
-
var INTERACTIVE_TOOL_NAMES = ["AskUserQuestion", "ExitPlanMode"];
|
|
13449
13425
|
var COMMAND_PROTECTION_SAFE_TOOLS = /* @__PURE__ */ new Set([
|
|
13450
13426
|
"Read",
|
|
13451
13427
|
"Write",
|
|
@@ -13468,80 +13444,6 @@ function supportsClaudeThinkingDisplay(model) {
|
|
|
13468
13444
|
const normalized = (normalizeClaudeModel(model) ?? model).toLowerCase();
|
|
13469
13445
|
return AGENT_MODELS.claude.includes(normalized) || /^claude-(?:opus|sonnet|haiku)-[4-9]/.test(normalized);
|
|
13470
13446
|
}
|
|
13471
|
-
var TOOL_INPUT_HANDLERS = {
|
|
13472
|
-
ExitPlanMode: {
|
|
13473
|
-
getRequest: () => ({
|
|
13474
|
-
options: [
|
|
13475
|
-
{ id: "approve", label: "Start implementing", variant: "primary" },
|
|
13476
|
-
{ id: "deny", label: "Keep planning", variant: "secondary" }
|
|
13477
|
-
]
|
|
13478
|
-
}),
|
|
13479
|
-
resolve: (selectionId, input) => {
|
|
13480
|
-
if (selectionId === "approve") {
|
|
13481
|
-
return { result: { behavior: "allow", updatedInput: input }, summary: "Start implementing" };
|
|
13482
|
-
}
|
|
13483
|
-
return { result: { behavior: "deny", message: "User declined to exit plan mode." }, summary: "Keep planning" };
|
|
13484
|
-
}
|
|
13485
|
-
},
|
|
13486
|
-
AskUserQuestion: {
|
|
13487
|
-
getRequest: (input) => {
|
|
13488
|
-
const questions = Array.isArray(input.questions) ? input.questions : [];
|
|
13489
|
-
return {
|
|
13490
|
-
questions: questions.map((q, qi) => ({
|
|
13491
|
-
id: String(qi),
|
|
13492
|
-
prompt: q.question,
|
|
13493
|
-
multiSelect: Boolean(q.multiSelect),
|
|
13494
|
-
options: (q.options ?? []).map((opt, oi) => ({
|
|
13495
|
-
id: String(oi),
|
|
13496
|
-
label: opt.label,
|
|
13497
|
-
description: opt.description,
|
|
13498
|
-
preview: opt.preview
|
|
13499
|
-
}))
|
|
13500
|
-
}))
|
|
13501
|
-
};
|
|
13502
|
-
},
|
|
13503
|
-
resolve: (selectionId, input) => {
|
|
13504
|
-
if (selectionId === "declined") {
|
|
13505
|
-
return {
|
|
13506
|
-
result: { behavior: "deny", message: "User declined to answer questions." },
|
|
13507
|
-
summary: "Declined to answer"
|
|
13508
|
-
};
|
|
13509
|
-
}
|
|
13510
|
-
let parsed;
|
|
13511
|
-
try {
|
|
13512
|
-
parsed = JSON.parse(selectionId);
|
|
13513
|
-
} catch {
|
|
13514
|
-
return {
|
|
13515
|
-
result: { behavior: "deny", message: "Invalid selection payload." }
|
|
13516
|
-
};
|
|
13517
|
-
}
|
|
13518
|
-
const questions = Array.isArray(input.questions) ? input.questions : [];
|
|
13519
|
-
const answers = {};
|
|
13520
|
-
const summaryParts = [];
|
|
13521
|
-
for (let qi = 0; qi < questions.length; qi++) {
|
|
13522
|
-
const q = questions[qi];
|
|
13523
|
-
const { custom, options } = toolInputAnswer(parsed, String(qi));
|
|
13524
|
-
let answer = null;
|
|
13525
|
-
if (custom) {
|
|
13526
|
-
answer = custom;
|
|
13527
|
-
} else if (options.length > 0) {
|
|
13528
|
-
const labels = options.map((idx) => q.options[Number(idx)]?.label).filter((l) => Boolean(l));
|
|
13529
|
-
if (labels.length > 0) {
|
|
13530
|
-
answer = labels.join(", ");
|
|
13531
|
-
}
|
|
13532
|
-
}
|
|
13533
|
-
if (answer) {
|
|
13534
|
-
answers[q.question] = answer;
|
|
13535
|
-
summaryParts.push(`${q.question}: ${answer}`);
|
|
13536
|
-
}
|
|
13537
|
-
}
|
|
13538
|
-
return {
|
|
13539
|
-
result: { behavior: "allow", updatedInput: { ...input, answers } },
|
|
13540
|
-
summary: summaryParts.join(" \u2022 ")
|
|
13541
|
-
};
|
|
13542
|
-
}
|
|
13543
|
-
}
|
|
13544
|
-
};
|
|
13545
13447
|
var ClaudeAuthError = class extends Error {
|
|
13546
13448
|
constructor(message) {
|
|
13547
13449
|
super(message);
|
|
@@ -13664,8 +13566,6 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13664
13566
|
partialMessageStreams = /* @__PURE__ */ new Map();
|
|
13665
13567
|
requestsInFlight = /* @__PURE__ */ new Map();
|
|
13666
13568
|
partialMessageFlushTimers = /* @__PURE__ */ new Map();
|
|
13667
|
-
/** Active tool-input requests keyed by requestId; resolved when the user selects an option. */
|
|
13668
|
-
pendingToolInputs = /* @__PURE__ */ new Map();
|
|
13669
13569
|
supportedSlashCommands = [];
|
|
13670
13570
|
slashCommandsDiscoveredAt = 0;
|
|
13671
13571
|
slashCommandsDiscovery = null;
|
|
@@ -13691,7 +13591,6 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13691
13591
|
this.pendingInterrupt = true;
|
|
13692
13592
|
this.stoppedAtMs = stoppedAt ? Date.parse(stoppedAt) : Date.now();
|
|
13693
13593
|
const stopping = (async () => {
|
|
13694
|
-
await this.abortAllPendingToolInputs();
|
|
13695
13594
|
const query2 = this.activeQuery;
|
|
13696
13595
|
if (query2) {
|
|
13697
13596
|
const interrupt = query2.interrupt.bind(query2);
|
|
@@ -13839,22 +13738,6 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13839
13738
|
return;
|
|
13840
13739
|
}
|
|
13841
13740
|
}
|
|
13842
|
-
async abortAllPendingToolInputs() {
|
|
13843
|
-
const pending = Array.from(this.pendingToolInputs.values());
|
|
13844
|
-
this.pendingToolInputs.clear();
|
|
13845
|
-
for (const entry of pending) {
|
|
13846
|
-
entry.resolve({ behavior: "deny", message: "Turn interrupted" });
|
|
13847
|
-
await this.emitToolInputEvent("replicas-tool-input-resolved", {
|
|
13848
|
-
requestId: entry.requestId,
|
|
13849
|
-
toolUseId: entry.toolUseId,
|
|
13850
|
-
toolName: entry.toolName,
|
|
13851
|
-
selectionId: "aborted"
|
|
13852
|
-
});
|
|
13853
|
-
}
|
|
13854
|
-
}
|
|
13855
|
-
isAwaitingInput() {
|
|
13856
|
-
return this.pendingToolInputs.size > 0;
|
|
13857
|
-
}
|
|
13858
13741
|
isAuthRetrying() {
|
|
13859
13742
|
return this.authRetrying;
|
|
13860
13743
|
}
|
|
@@ -13967,82 +13850,6 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13967
13850
|
this.authRetrying = value;
|
|
13968
13851
|
this.emitSyntheticEvent(AUTH_RETRY_STATUS_EVENT_TYPE, { isAuthRetrying: value });
|
|
13969
13852
|
}
|
|
13970
|
-
async respondToToolInput(requestId, selectionId) {
|
|
13971
|
-
const pending = this.pendingToolInputs.get(requestId);
|
|
13972
|
-
if (!pending) {
|
|
13973
|
-
return false;
|
|
13974
|
-
}
|
|
13975
|
-
this.pendingToolInputs.delete(requestId);
|
|
13976
|
-
const resolution = pending.handler.resolve(selectionId, pending.input);
|
|
13977
|
-
pending.resolve(resolution.result);
|
|
13978
|
-
await this.emitToolInputEvent("replicas-tool-input-resolved", {
|
|
13979
|
-
requestId,
|
|
13980
|
-
toolUseId: pending.toolUseId,
|
|
13981
|
-
toolName: pending.toolName,
|
|
13982
|
-
selectionId,
|
|
13983
|
-
...resolution.summary ? { selectionSummary: resolution.summary } : {}
|
|
13984
|
-
});
|
|
13985
|
-
return true;
|
|
13986
|
-
}
|
|
13987
|
-
async emitToolInputEvent(type, payload) {
|
|
13988
|
-
const event = {
|
|
13989
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
13990
|
-
type,
|
|
13991
|
-
payload: { ...payload, parent_tool_use_id: null }
|
|
13992
|
-
};
|
|
13993
|
-
this.record(event);
|
|
13994
|
-
}
|
|
13995
|
-
buildCanUseTool() {
|
|
13996
|
-
return async (toolName, input, options) => {
|
|
13997
|
-
const handler = TOOL_INPUT_HANDLERS[toolName];
|
|
13998
|
-
if (!handler) {
|
|
13999
|
-
return { behavior: "allow" };
|
|
14000
|
-
}
|
|
14001
|
-
const requestId = randomUUID3();
|
|
14002
|
-
const toolUseId = options.toolUseID;
|
|
14003
|
-
const { options: requestOptions, questions: requestQuestions } = handler.getRequest(input);
|
|
14004
|
-
const result = await new Promise((resolve9) => {
|
|
14005
|
-
this.pendingToolInputs.set(requestId, {
|
|
14006
|
-
requestId,
|
|
14007
|
-
toolUseId,
|
|
14008
|
-
toolName,
|
|
14009
|
-
input,
|
|
14010
|
-
handler,
|
|
14011
|
-
resolve: resolve9
|
|
14012
|
-
});
|
|
14013
|
-
const onAbort = () => {
|
|
14014
|
-
const pending = this.pendingToolInputs.get(requestId);
|
|
14015
|
-
if (!pending) return;
|
|
14016
|
-
this.pendingToolInputs.delete(requestId);
|
|
14017
|
-
pending.resolve({ behavior: "deny", message: "Aborted." });
|
|
14018
|
-
this.emitToolInputEvent("replicas-tool-input-resolved", {
|
|
14019
|
-
requestId: pending.requestId,
|
|
14020
|
-
toolUseId: pending.toolUseId,
|
|
14021
|
-
toolName: pending.toolName,
|
|
14022
|
-
selectionId: "aborted"
|
|
14023
|
-
}).catch((err) => {
|
|
14024
|
-
console.error("[ClaudeManager] Failed to emit resolved event on abort:", err);
|
|
14025
|
-
});
|
|
14026
|
-
};
|
|
14027
|
-
if (options.signal.aborted) {
|
|
14028
|
-
onAbort();
|
|
14029
|
-
return;
|
|
14030
|
-
}
|
|
14031
|
-
options.signal.addEventListener("abort", onAbort, { once: true });
|
|
14032
|
-
this.emitToolInputEvent("replicas-tool-input-request", {
|
|
14033
|
-
requestId,
|
|
14034
|
-
toolUseId,
|
|
14035
|
-
toolName,
|
|
14036
|
-
...requestOptions ? { options: requestOptions } : {},
|
|
14037
|
-
...requestQuestions ? { questions: requestQuestions } : {},
|
|
14038
|
-
...typeof input.plan === "string" ? { plan: input.plan } : {}
|
|
14039
|
-
}).catch((err) => {
|
|
14040
|
-
console.error("[ClaudeManager] Failed to emit tool-input request event:", err);
|
|
14041
|
-
});
|
|
14042
|
-
});
|
|
14043
|
-
return result;
|
|
14044
|
-
};
|
|
14045
|
-
}
|
|
14046
13853
|
buildCommandProtectionHook() {
|
|
14047
13854
|
return async (input, toolUseID, options) => {
|
|
14048
13855
|
if (input.hook_event_name !== "PreToolUse") return {};
|
|
@@ -14335,9 +14142,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14335
14142
|
message,
|
|
14336
14143
|
model,
|
|
14337
14144
|
customInstructions,
|
|
14338
|
-
planMode,
|
|
14339
14145
|
thinkingLevel,
|
|
14340
|
-
enableInteractiveTools,
|
|
14341
14146
|
fastMode
|
|
14342
14147
|
} = request;
|
|
14343
14148
|
if (!message || !message.trim()) {
|
|
@@ -14375,25 +14180,20 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14375
14180
|
const authMethod = resolveClaudeAuthMethodForMessage();
|
|
14376
14181
|
const isClaudeModel = !!requestedModel && /^claude-/i.test(requestedModel);
|
|
14377
14182
|
const resolvedModel = authMethod === "ollama" ? getFallbackModel("claude") ?? (requestedModel && !isClaudeModel ? requestedModel : DEFAULT_OLLAMA_MODEL) : (authMethod === "oauth" || authMethod === "api_key") && requestedModel && !isClaudeModel ? DEFAULT_CLAUDE_MODEL : requestedModel || DEFAULT_CLAUDE_MODEL;
|
|
14378
|
-
const resolvedPermissionMode = planMode ? "plan" : "bypassPermissions";
|
|
14379
14183
|
const resolvedFastMode = Boolean(fastMode && canUseClaudeFastMode(resolvedModel));
|
|
14380
14184
|
this.onChatCredential("workspace");
|
|
14381
14185
|
const signature = {
|
|
14382
14186
|
credential: JSON.stringify(ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.claude),
|
|
14383
14187
|
combinedInstructions,
|
|
14384
14188
|
thinkingLevel,
|
|
14385
|
-
enableInteractiveTools: Boolean(enableInteractiveTools),
|
|
14386
14189
|
fastMode: resolvedFastMode,
|
|
14387
14190
|
autoCompactTokens: this.autoCompactTokens,
|
|
14388
|
-
permissionMode: resolvedPermissionMode,
|
|
14389
14191
|
subagentMcpParentChatId: this.subagentMcpParentChatId()
|
|
14390
14192
|
};
|
|
14391
14193
|
await this.ensureSession({
|
|
14392
14194
|
signature,
|
|
14393
14195
|
combinedInstructions,
|
|
14394
14196
|
resolvedModel,
|
|
14395
|
-
resolvedPermissionMode,
|
|
14396
|
-
enableInteractiveTools: signature.enableInteractiveTools,
|
|
14397
14197
|
thinkingLevel
|
|
14398
14198
|
});
|
|
14399
14199
|
const promptStream = this.activePromptStream;
|
|
@@ -14491,8 +14291,6 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14491
14291
|
signature,
|
|
14492
14292
|
combinedInstructions,
|
|
14493
14293
|
resolvedModel,
|
|
14494
|
-
resolvedPermissionMode,
|
|
14495
|
-
enableInteractiveTools,
|
|
14496
14294
|
thinkingLevel
|
|
14497
14295
|
} = args;
|
|
14498
14296
|
if (this.activeQuery && this.activeSessionSignature && (this.sessionSignaturesMatch(this.activeSessionSignature, signature) || this.backgroundTasks.active.size > 0 && this.activeSessionSignature.credential === signature.credential)) {
|
|
@@ -14512,14 +14310,12 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14512
14310
|
await this.startSession({
|
|
14513
14311
|
combinedInstructions,
|
|
14514
14312
|
resolvedModel,
|
|
14515
|
-
resolvedPermissionMode,
|
|
14516
|
-
enableInteractiveTools,
|
|
14517
14313
|
thinkingLevel,
|
|
14518
14314
|
signature
|
|
14519
14315
|
});
|
|
14520
14316
|
}
|
|
14521
14317
|
sessionSignaturesMatch(a, b) {
|
|
14522
|
-
return a.combinedInstructions === b.combinedInstructions && a.credential === b.credential && a.thinkingLevel === b.thinkingLevel && a.
|
|
14318
|
+
return a.combinedInstructions === b.combinedInstructions && a.credential === b.credential && a.thinkingLevel === b.thinkingLevel && a.fastMode === b.fastMode && a.autoCompactTokens === b.autoCompactTokens && a.subagentMcpParentChatId === b.subagentMcpParentChatId;
|
|
14523
14319
|
}
|
|
14524
14320
|
/** Query inputs shared by real sessions and slash-command discovery. */
|
|
14525
14321
|
async buildSharedQueryOptions() {
|
|
@@ -14545,8 +14341,6 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14545
14341
|
const {
|
|
14546
14342
|
combinedInstructions,
|
|
14547
14343
|
resolvedModel,
|
|
14548
|
-
resolvedPermissionMode,
|
|
14549
|
-
enableInteractiveTools,
|
|
14550
14344
|
thinkingLevel,
|
|
14551
14345
|
signature
|
|
14552
14346
|
} = args;
|
|
@@ -14560,17 +14354,10 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14560
14354
|
snapshot: false
|
|
14561
14355
|
};
|
|
14562
14356
|
const shared = await this.buildSharedQueryOptions();
|
|
14563
|
-
const interactiveAllowed = enableInteractiveTools && resolvedPermissionMode === "plan";
|
|
14564
14357
|
const subagentMcpParentChatId = signature.subagentMcpParentChatId;
|
|
14565
|
-
const allowedTools = [
|
|
14566
|
-
...ALWAYS_ALLOWED_TOOLS.filter((tool) => !subagentMcpParentChatId || tool !== "Agent"),
|
|
14567
|
-
...subagentMcpParentChatId ? SUBAGENT_MCP_TOOL_NAMES.map((tool) => `mcp__${SUBAGENT_MCP_SERVER_NAME}__${tool}`) : [],
|
|
14568
|
-
...interactiveAllowed ? INTERACTIVE_TOOL_NAMES : []
|
|
14569
|
-
];
|
|
14570
14358
|
const disallowedTools = [
|
|
14571
14359
|
...ALWAYS_DISALLOWED_TOOLS,
|
|
14572
|
-
...subagentMcpParentChatId ? ["Agent"] : []
|
|
14573
|
-
...interactiveAllowed ? [] : INTERACTIVE_TOOL_NAMES
|
|
14360
|
+
...subagentMcpParentChatId ? ["Agent"] : []
|
|
14574
14361
|
];
|
|
14575
14362
|
const promptStream = new PromptStream();
|
|
14576
14363
|
const response = query({
|
|
@@ -14579,10 +14366,9 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14579
14366
|
resume: this.sessionId || void 0,
|
|
14580
14367
|
cwd: this.workingDirectory,
|
|
14581
14368
|
additionalDirectories: shared.additionalDirectories,
|
|
14582
|
-
permissionMode:
|
|
14583
|
-
allowDangerouslySkipPermissions:
|
|
14584
|
-
|
|
14585
|
-
...disallowedTools.length > 0 ? { disallowedTools } : {},
|
|
14369
|
+
permissionMode: "bypassPermissions",
|
|
14370
|
+
allowDangerouslySkipPermissions: true,
|
|
14371
|
+
disallowedTools,
|
|
14586
14372
|
settingSources: ["user", "project", "local"],
|
|
14587
14373
|
systemPrompt,
|
|
14588
14374
|
...subagentMcpParentChatId ? { mcpServers: { [SUBAGENT_MCP_SERVER_NAME]: { type: "stdio", alwaysLoad: true, ...subagentMcpProcessConfig(subagentMcpParentChatId) } } } : {},
|
|
@@ -14605,7 +14391,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14605
14391
|
...this.chatTitle ? { title: this.chatTitle() } : {},
|
|
14606
14392
|
settings: {
|
|
14607
14393
|
fastMode: signature.fastMode,
|
|
14608
|
-
// Every session in the sandbox is one of the user's chats; the default holds
|
|
14394
|
+
// Every session in the sandbox is one of the user's chats; the default holds some peer messages for an approval no one is there to give.
|
|
14609
14395
|
crossSessionInbound: "accept",
|
|
14610
14396
|
...signature.autoCompactTokens ? { autoCompactWindow: signature.autoCompactTokens } : {},
|
|
14611
14397
|
...ultracode ? { enableWorkflows: true, ultracode: true } : {}
|
|
@@ -14614,7 +14400,6 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14614
14400
|
forwardSubagentText: true,
|
|
14615
14401
|
...supportsClaudeThinkingDisplay(resolvedModel) ? { thinking: { type: "adaptive", display: "summarized" } } : {},
|
|
14616
14402
|
...effort ? { effort } : {},
|
|
14617
|
-
...resolvedPermissionMode === "plan" ? { canUseTool: this.buildCanUseTool() } : {},
|
|
14618
14403
|
hooks: {
|
|
14619
14404
|
PreToolUse: [{
|
|
14620
14405
|
matcher: "*",
|
|
@@ -14914,7 +14699,7 @@ ${msg.result}` } : { ...msg, errors: [loginFailure, ...msg.errors] } : msg);
|
|
|
14914
14699
|
this.backgroundContinuationTimer = null;
|
|
14915
14700
|
if (this.pendingInterrupt || this.backgroundTasks.active.size > 0) return;
|
|
14916
14701
|
if (this.sessionActivity.state === "running" && !this.pendingTurn) return;
|
|
14917
|
-
if (this.pendingTurn || this.messageQueue.isProcessing() || this.
|
|
14702
|
+
if (this.pendingTurn || this.messageQueue.isProcessing() || this.sessionActivity.state === "requires_action") {
|
|
14918
14703
|
this.backgroundContinuationTimer = setTimeout(() => this.recoverBackgroundContinuation(query2), CLAUDE_BACKGROUND_CONTINUATION_GRACE_MS);
|
|
14919
14704
|
return;
|
|
14920
14705
|
}
|
|
@@ -14939,11 +14724,9 @@ ${msg.result}` } : { ...msg, errors: [loginFailure, ...msg.errors] } : msg);
|
|
|
14939
14724
|
async failBackgroundSession(query2, message) {
|
|
14940
14725
|
if (this.activeQuery !== query2) return;
|
|
14941
14726
|
await this.emitTerminalErrorResult(message, [message]);
|
|
14942
|
-
await this.abortAllPendingToolInputs();
|
|
14943
14727
|
if (this.activeQuery === query2) await this.tearDownSession();
|
|
14944
14728
|
}
|
|
14945
14729
|
async dispose() {
|
|
14946
|
-
await this.abortAllPendingToolInputs();
|
|
14947
14730
|
await this.tearDownSession();
|
|
14948
14731
|
}
|
|
14949
14732
|
async forkPoint(beforeMessageId) {
|
|
@@ -17521,7 +17304,7 @@ var CursorManager = class extends CodingAgentManager {
|
|
|
17521
17304
|
this.recordUserMessageHistoryEvent(request, {}, this.turnBeganAt);
|
|
17522
17305
|
const sending = sendCursorRun(agent, message, {
|
|
17523
17306
|
model: { id: model },
|
|
17524
|
-
mode:
|
|
17307
|
+
mode: "agent",
|
|
17525
17308
|
onDelta: (args) => {
|
|
17526
17309
|
markCursorActivity();
|
|
17527
17310
|
this.recordCursorContextUsage(args.update);
|
|
@@ -18028,7 +17811,7 @@ ${typeof pending.subject.command === "string" ? pending.subject.command : JSON.s
|
|
|
18028
17811
|
await this.request("session/setApprovalMode", {
|
|
18029
17812
|
commandId: uuidV7(),
|
|
18030
17813
|
sessionId: this.sessionId,
|
|
18031
|
-
mode:
|
|
17814
|
+
mode: "allowAll"
|
|
18032
17815
|
});
|
|
18033
17816
|
await this.request("session/setModel", {
|
|
18034
17817
|
commandId: uuidV7(),
|
|
@@ -18041,7 +17824,7 @@ ${typeof pending.subject.command === "string" ? pending.subject.command : JSON.s
|
|
|
18041
17824
|
${pending}
|
|
18042
17825
|
</workspace-instructions>
|
|
18043
17826
|
|
|
18044
|
-
` : ""}${request.
|
|
17827
|
+
` : ""}${request.message}`;
|
|
18045
17828
|
if (!this.deliver(signal)) return;
|
|
18046
17829
|
recordUserMessage();
|
|
18047
17830
|
this.turnError = null;
|
|
@@ -18615,7 +18398,7 @@ var OpencodeManager = class extends CodingAgentManager {
|
|
|
18615
18398
|
});
|
|
18616
18399
|
turn.abort();
|
|
18617
18400
|
}
|
|
18618
|
-
async ensureSession(client, providerID, model,
|
|
18401
|
+
async ensureSession(client, providerID, model, variant) {
|
|
18619
18402
|
if (this.sessionId) {
|
|
18620
18403
|
try {
|
|
18621
18404
|
await client.session.get(
|
|
@@ -18629,7 +18412,7 @@ var OpencodeManager = class extends CodingAgentManager {
|
|
|
18629
18412
|
}
|
|
18630
18413
|
const result = await client.session.create({
|
|
18631
18414
|
directory: this.workingDirectory,
|
|
18632
|
-
agent,
|
|
18415
|
+
agent: "build",
|
|
18633
18416
|
model: { providerID, id: model, ...variant ? { variant } : {} }
|
|
18634
18417
|
}, { throwOnError: true });
|
|
18635
18418
|
const session = result.data;
|
|
@@ -18684,9 +18467,8 @@ var OpencodeManager = class extends CodingAgentManager {
|
|
|
18684
18467
|
const client = await this.ensureClient(model, provider);
|
|
18685
18468
|
server3 = this.server;
|
|
18686
18469
|
const { providerID, modelID } = opencodeModelRef(this.providerId, model);
|
|
18687
|
-
const agent = request.planMode ? "plan" : "build";
|
|
18688
18470
|
const variant = await this.getThinkingVariant(client, providerID, modelID, request.thinkingLevel);
|
|
18689
|
-
const sessionId = await this.ensureSession(client, providerID, modelID,
|
|
18471
|
+
const sessionId = await this.ensureSession(client, providerID, modelID, variant);
|
|
18690
18472
|
const system = this.buildCombinedInstructions(request.customInstructions);
|
|
18691
18473
|
if (!retry) {
|
|
18692
18474
|
if (!this.deliver(signal)) return false;
|
|
@@ -18695,7 +18477,7 @@ var OpencodeManager = class extends CodingAgentManager {
|
|
|
18695
18477
|
const result = await client.session.prompt({
|
|
18696
18478
|
sessionID: sessionId,
|
|
18697
18479
|
directory: this.workingDirectory,
|
|
18698
|
-
agent,
|
|
18480
|
+
agent: "build",
|
|
18699
18481
|
model: { providerID, modelID },
|
|
18700
18482
|
...variant ? { variant } : {},
|
|
18701
18483
|
...system ? { system } : {},
|
|
@@ -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-ESENYL7M.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-YNHFXBHT.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