replicas-engine 0.1.1688 → 0.1.1691
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-ZQHJIZ66.js → asp-host-6F6YGLQL.js} +6 -6
- package/dist/src/{chunk-EKP2WDE7.js → chunk-2QWCRIV5.js} +2 -2
- package/dist/src/{chunk-PSCQSFAO.js → chunk-4XN65A5I.js} +7 -7
- package/dist/src/{chunk-OWOVJSPF.js → chunk-6NZ2BNFO.js} +1 -1
- package/dist/src/{chunk-7PMLZC3V.js → chunk-CTCJMQUE.js} +1 -1
- package/dist/src/{chunk-2FQOMURD.js → chunk-F2DLY4E6.js} +2 -2
- package/dist/src/{chunk-QQ46DGF7.js → chunk-F4D2ZOED.js} +3 -3
- package/dist/src/{chunk-ID3TOAOH.js → chunk-MJWJP6RQ.js} +1 -1
- package/dist/src/{chunk-NFRBKHVR.js → chunk-PHNKPAWA.js} +25 -14
- package/dist/src/{chunk-JRVPCYO2.js → chunk-ZN4BSDP7.js} +1 -1
- package/dist/src/{chunk-RECB5M3N.js → chunk-ZP6BBTFK.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 +29 -17
- 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-4XN65A5I.js";
|
|
12
|
+
import "./chunk-CTCJMQUE.js";
|
|
13
|
+
import "./chunk-2QWCRIV5.js";
|
|
14
|
+
import "./chunk-F4D2ZOED.js";
|
|
15
|
+
import "./chunk-6NZ2BNFO.js";
|
|
16
16
|
import "./chunk-UZSNFLDQ.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-PHNKPAWA.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-6NZ2BNFO.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-PHNKPAWA.js";
|
|
25
25
|
|
|
26
26
|
// src/runtime-env-loader.ts
|
|
27
27
|
import { readFileSync } 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-CTCJMQUE.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-2QWCRIV5.js";
|
|
19
19
|
import {
|
|
20
20
|
AppServerProcess,
|
|
21
21
|
buildCodexAgentEnv
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-F4D2ZOED.js";
|
|
23
23
|
import {
|
|
24
24
|
SUBPROCESS_MAX_BUFFER,
|
|
25
25
|
execFileAsync
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-6NZ2BNFO.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-PHNKPAWA.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-6F6YGLQL.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-6F6YGLQL.js");
|
|
489
489
|
await restartCodexAspHostIfRunning2();
|
|
490
490
|
}
|
|
491
491
|
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
|
HOOK_EXEC_MAX_BUFFER_BYTES
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PHNKPAWA.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-PHNKPAWA.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-2QWCRIV5.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-PHNKPAWA.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-6NZ2BNFO.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PHNKPAWA.js";
|
|
10
10
|
|
|
11
11
|
// src/utils/codex-agent-env.ts
|
|
12
12
|
function buildCodexAgentEnv(source = process.env) {
|
|
@@ -242,7 +242,7 @@ function getCodexModelProvider(method) {
|
|
|
242
242
|
if (method === "foundry") return "azure";
|
|
243
243
|
return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
|
|
244
244
|
}
|
|
245
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
245
|
+
var ENGINE_PACKAGE_VERSION = "0.1.1691";
|
|
246
246
|
var INITIALIZE_METHOD = "initialize";
|
|
247
247
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
248
248
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -11472,6 +11472,8 @@ var interruptChatRequestSchema = z9.object({
|
|
|
11472
11472
|
// The workspace's stop count once this Stop was noted: set by the monolith alone. A send that saw a lower count is older than this Stop.
|
|
11473
11473
|
stopNumber: z9.number().int().positive().optional()
|
|
11474
11474
|
});
|
|
11475
|
+
var turnStoppedSchema = z9.object({ byUserId: z9.string().optional() });
|
|
11476
|
+
var engineInterruptChatRequestSchema = interruptChatRequestSchema.extend({ stopped: turnStoppedSchema.optional() });
|
|
11475
11477
|
var respondToolInputRequestSchema = z9.object({
|
|
11476
11478
|
requestId: z9.string().min(1),
|
|
11477
11479
|
selectionId: z9.string().min(1),
|
|
@@ -20127,6 +20129,7 @@ function extractToolResult(event) {
|
|
|
20127
20129
|
toolUseId: toolResult.tool_use_id,
|
|
20128
20130
|
output,
|
|
20129
20131
|
outputOmitted: toolResult.replicasOmitted,
|
|
20132
|
+
images: contentImages(normalizeContentBlocks(toolResult.content)),
|
|
20130
20133
|
exitCode: exitCode === void 0 ? void 0 : parseInt(exitCode, 10),
|
|
20131
20134
|
status: toolResult.is_error ? "failed" : "completed"
|
|
20132
20135
|
};
|
|
@@ -20158,16 +20161,19 @@ function readClaudeUserPrompt(payload, content) {
|
|
|
20158
20161
|
if (payload.isSynthetic || content.some((c) => c.type === "tool_result" && c.tool_use_id)) return void 0;
|
|
20159
20162
|
const text4 = content.filter((c) => c.type === "text").map((c) => c.text || "").join("\n");
|
|
20160
20163
|
if (LOCAL_COMMAND_ECHO_REGEX.test(text4.trim())) return void 0;
|
|
20161
|
-
const images = content
|
|
20162
|
-
|
|
20163
|
-
|
|
20164
|
+
const images = contentImages(content);
|
|
20165
|
+
return text4 || images.length > 0 ? { text: text4, images } : void 0;
|
|
20166
|
+
}
|
|
20167
|
+
function contentImages(content) {
|
|
20168
|
+
return content.flatMap((c) => {
|
|
20169
|
+
if (c.type !== "image" || !c.source || !c.source.data && !c.replicasOmitted) return [];
|
|
20170
|
+
return [{
|
|
20164
20171
|
type: "image",
|
|
20165
|
-
mediaType: source.media_type || "image/png",
|
|
20166
|
-
data: source.data || "",
|
|
20172
|
+
mediaType: c.source.media_type || "image/png",
|
|
20173
|
+
data: c.source.data || "",
|
|
20167
20174
|
...c.replicasOmitted ? { replicasOmitted: c.replicasOmitted } : {}
|
|
20168
|
-
};
|
|
20169
|
-
})
|
|
20170
|
-
return text4 || images.length > 0 ? { text: text4, images } : void 0;
|
|
20175
|
+
}];
|
|
20176
|
+
});
|
|
20171
20177
|
}
|
|
20172
20178
|
function parseClaudeEvents(events, parentToolUseId) {
|
|
20173
20179
|
const messages = [];
|
|
@@ -20651,6 +20657,7 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
20651
20657
|
} else if (message2.type === "tool_call") {
|
|
20652
20658
|
message2.output = resultContent;
|
|
20653
20659
|
message2.outputOmitted = outputOmitted;
|
|
20660
|
+
if (result.images.length > 0) message2.images = result.images;
|
|
20654
20661
|
message2.status = status;
|
|
20655
20662
|
} else if (message2.type === "skill" && isError && message2.path) {
|
|
20656
20663
|
replaceMessage(toolInfo.messageIndex, { id: message2.id, type: "tool_call", server: "claude", tool: toolInfo.toolName, input: toolInfo.input, output: resultContent, outputOmitted, status, timestamp: message2.timestamp });
|
|
@@ -21274,10 +21281,14 @@ function compactChatHistoryEvent(event, record) {
|
|
|
21274
21281
|
const text4 = extractToolResultText(block.content);
|
|
21275
21282
|
if (isStructuredToolOutput(text4)) return block;
|
|
21276
21283
|
const omitted = omit(text4);
|
|
21277
|
-
|
|
21278
|
-
if (!
|
|
21279
|
-
|
|
21280
|
-
return {
|
|
21284
|
+
const images = Array.isArray(block.content) ? block.content.filter((part) => isRecord(part) && part.type === "image") : [];
|
|
21285
|
+
if (!omitted && images.length === 0) return block;
|
|
21286
|
+
const preview = omitted ? text4.slice(0, COMPACT_PREVIEW_CHARS) : text4;
|
|
21287
|
+
return {
|
|
21288
|
+
...block,
|
|
21289
|
+
content: images.length > 0 ? [...preview ? [{ type: "text", text: preview }] : [], ...images.map(compactImage)] : preview,
|
|
21290
|
+
...omitted
|
|
21291
|
+
};
|
|
21281
21292
|
})
|
|
21282
21293
|
}
|
|
21283
21294
|
};
|
|
@@ -21644,7 +21655,7 @@ async function withRetry(label, fn, options) {
|
|
|
21644
21655
|
}
|
|
21645
21656
|
|
|
21646
21657
|
// ../shared/src/tensorlake.ts
|
|
21647
|
-
var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-20-
|
|
21658
|
+
var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-20-v44";
|
|
21648
21659
|
var TENSORLAKE_DISK_MB = 100 * 1024;
|
|
21649
21660
|
|
|
21650
21661
|
// ../shared/src/egress.ts
|
|
@@ -24116,7 +24127,7 @@ export {
|
|
|
24116
24127
|
codexTranscriptToEvents,
|
|
24117
24128
|
steerQueuedInOrder,
|
|
24118
24129
|
sendChatMessageResponseSchema,
|
|
24119
|
-
|
|
24130
|
+
engineInterruptChatRequestSchema,
|
|
24120
24131
|
respondToolInputRequestSchema,
|
|
24121
24132
|
isLatestChatHistoryPage,
|
|
24122
24133
|
getChatHistoryPageSenders,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-7ZDAVYTV.js";
|
|
7
7
|
import {
|
|
8
8
|
AspClient
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-F4D2ZOED.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-PHNKPAWA.js";
|
|
22
22
|
|
|
23
23
|
// src/managers/codex-asp/notification-dispatch.ts
|
|
24
24
|
var TURN_STARTED_METHOD = "turn/started";
|
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-MJWJP6RQ.js";
|
|
8
8
|
import "./chunk-7ZDAVYTV.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-CTCJMQUE.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-PHNKPAWA.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-F2DLY4E6.js";
|
|
7
|
+
import "./chunk-2QWCRIV5.js";
|
|
8
|
+
import "./chunk-6NZ2BNFO.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-PHNKPAWA.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-ZP6BBTFK.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-F4D2ZOED.js";
|
|
23
|
+
import "./chunk-6NZ2BNFO.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-PHNKPAWA.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-MJWJP6RQ.js";
|
|
94
94
|
import {
|
|
95
95
|
evaluateCommandProtection,
|
|
96
96
|
extractToolCommand,
|
|
97
97
|
reportCommandProtectionBlock
|
|
98
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-F2DLY4E6.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-ZP6BBTFK.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-ZN4BSDP7.js";
|
|
141
141
|
import {
|
|
142
142
|
ACCOUNT_RATE_LIMITS_READ_METHOD,
|
|
143
143
|
AsyncLock,
|
|
@@ -214,12 +214,12 @@ import {
|
|
|
214
214
|
transcriptSecrets,
|
|
215
215
|
upsertCredentialFileLines,
|
|
216
216
|
writeSecureCredentialFile
|
|
217
|
-
} from "./chunk-
|
|
217
|
+
} from "./chunk-4XN65A5I.js";
|
|
218
218
|
import {
|
|
219
219
|
SUBAGENT_MCP_TOOL_TIMEOUT_MS,
|
|
220
220
|
engineScriptProcess,
|
|
221
221
|
subagentMcpProcessConfig
|
|
222
|
-
} from "./chunk-
|
|
222
|
+
} from "./chunk-CTCJMQUE.js";
|
|
223
223
|
import {
|
|
224
224
|
ENGINE_ENV,
|
|
225
225
|
UNQUOTED_PATHS_CONFIG,
|
|
@@ -230,17 +230,17 @@ import {
|
|
|
230
230
|
resolveDiffBase,
|
|
231
231
|
setAgentCredentialSnapshot,
|
|
232
232
|
setLinearSessionId
|
|
233
|
-
} from "./chunk-
|
|
233
|
+
} from "./chunk-2QWCRIV5.js";
|
|
234
234
|
import {
|
|
235
235
|
AspRequestTimeoutError,
|
|
236
236
|
buildCodexAgentEnv,
|
|
237
237
|
getCodexModelProvider
|
|
238
|
-
} from "./chunk-
|
|
238
|
+
} from "./chunk-F4D2ZOED.js";
|
|
239
239
|
import {
|
|
240
240
|
SUBPROCESS_MAX_BUFFER,
|
|
241
241
|
execAsync,
|
|
242
242
|
execFileAsync
|
|
243
|
-
} from "./chunk-
|
|
243
|
+
} from "./chunk-6NZ2BNFO.js";
|
|
244
244
|
import {
|
|
245
245
|
isRecord
|
|
246
246
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -409,6 +409,7 @@ import {
|
|
|
409
409
|
detectLanguageByPath,
|
|
410
410
|
encodeExecFrame,
|
|
411
411
|
engineCredentialRefreshFailureSchema,
|
|
412
|
+
engineInterruptChatRequestSchema,
|
|
412
413
|
engineMcpOAuthTokenResponseSchema,
|
|
413
414
|
excludeQueuedAcceptedEvents,
|
|
414
415
|
execRequestSchema,
|
|
@@ -447,7 +448,6 @@ import {
|
|
|
447
448
|
hasGeneratedChatTitle,
|
|
448
449
|
imageContentToUserMessageImages,
|
|
449
450
|
integrationErrorNotificationTargetSchema,
|
|
450
|
-
interruptChatRequestSchema,
|
|
451
451
|
isAgentChatMcpActivityRecord,
|
|
452
452
|
isAgentChatSkillActivityRecord,
|
|
453
453
|
isAgentChatTurnActivityRecord,
|
|
@@ -541,7 +541,7 @@ import {
|
|
|
541
541
|
workspaceTokenRequestSchema,
|
|
542
542
|
workspaceTokenResponseSchema,
|
|
543
543
|
wrapInTag
|
|
544
|
-
} from "./chunk-
|
|
544
|
+
} from "./chunk-PHNKPAWA.js";
|
|
545
545
|
import {
|
|
546
546
|
__commonJS,
|
|
547
547
|
__export,
|
|
@@ -62553,10 +62553,16 @@ ${decisions}` };
|
|
|
62553
62553
|
return [];
|
|
62554
62554
|
});
|
|
62555
62555
|
}
|
|
62556
|
-
async interrupt(chatId, stoppedAt) {
|
|
62556
|
+
async interrupt(chatId, stoppedAt, stopped) {
|
|
62557
62557
|
const chat = this.requireChat(chatId);
|
|
62558
62558
|
await Promise.race([Promise.all(chat.arrivingSends), sleep3(STOP_ARRIVAL_WAIT_MS, void 0, { ref: false })]);
|
|
62559
|
-
|
|
62559
|
+
if (stopped) chat.stopped = stopped;
|
|
62560
|
+
let result;
|
|
62561
|
+
try {
|
|
62562
|
+
result = await this.stopTurn(chat, stoppedAt);
|
|
62563
|
+
} finally {
|
|
62564
|
+
if (!result?.interrupted && chat.stopped === stopped) chat.stopped = null;
|
|
62565
|
+
}
|
|
62560
62566
|
this.touch(chat);
|
|
62561
62567
|
await this.publish({
|
|
62562
62568
|
type: "chat.interrupted",
|
|
@@ -63482,6 +63488,7 @@ ${note}`;
|
|
|
63482
63488
|
turnRequest: null,
|
|
63483
63489
|
turnAnswer: /* @__PURE__ */ new Map(),
|
|
63484
63490
|
turnCompletion: null,
|
|
63491
|
+
stopped: null,
|
|
63485
63492
|
publishedQueue: null,
|
|
63486
63493
|
idleReleaseTimer: null,
|
|
63487
63494
|
history,
|
|
@@ -63538,6 +63545,7 @@ ${note}`;
|
|
|
63538
63545
|
}
|
|
63539
63546
|
activateTurn(chat, messageId) {
|
|
63540
63547
|
chat.hasActiveTurn = true;
|
|
63548
|
+
chat.stopped = null;
|
|
63541
63549
|
chat.activeMessageId = messageId;
|
|
63542
63550
|
chat.activeErrorNotificationTargets = chat.errorNotificationTargets.get(messageId) ?? [];
|
|
63543
63551
|
chat.errorNotificationTargets.delete(messageId);
|
|
@@ -63806,6 +63814,9 @@ ${note}`;
|
|
|
63806
63814
|
const processing = chat.provider.getQueue().length > 0;
|
|
63807
63815
|
const exhaustion = chat.quotaExhaustion;
|
|
63808
63816
|
chat.quotaExhaustion = null;
|
|
63817
|
+
const stopped = chat.stopped;
|
|
63818
|
+
chat.stopped = null;
|
|
63819
|
+
if (stopped) chat.lastTurnErrors = null;
|
|
63809
63820
|
this.persistTurnArtifacts(chat);
|
|
63810
63821
|
let forked = false;
|
|
63811
63822
|
if (exhaustion) {
|
|
@@ -63821,7 +63832,7 @@ ${note}`;
|
|
|
63821
63832
|
chat.turnAnswer.clear();
|
|
63822
63833
|
if (answer) chat.turnRequest = null;
|
|
63823
63834
|
const responseComplete = this.publishTurnCompleted(chat, completedAt, stillProcessing, answer, request, userTurn);
|
|
63824
|
-
const completion = this.publishAgentTurnCompleteWebhook(chat, completedAt, stillProcessing, forked ? null : exhaustion, responseComplete, chat.turnCompletion, lostToRestart).catch((error) => console.error("[ChatService] Failed to report turn completion:", { chatId, error })).finally(() => {
|
|
63835
|
+
const completion = this.publishAgentTurnCompleteWebhook(chat, completedAt, stillProcessing, forked ? null : exhaustion, responseComplete, chat.turnCompletion, lostToRestart, stopped).catch((error) => console.error("[ChatService] Failed to report turn completion:", { chatId, error })).finally(() => {
|
|
63825
63836
|
if (chat.turnCompletion === completion) chat.turnCompletion = null;
|
|
63826
63837
|
this.notifyWorkspaceAgentIdle();
|
|
63827
63838
|
this.scheduleIdleRelease(chat);
|
|
@@ -63971,7 +63982,7 @@ ${note}`;
|
|
|
63971
63982
|
} catch {
|
|
63972
63983
|
}
|
|
63973
63984
|
}
|
|
63974
|
-
async publishAgentTurnCompleteWebhook(chat, completedAt, processing, quotaExhaustion, responseComplete, previousCompletion, turnLost) {
|
|
63985
|
+
async publishAgentTurnCompleteWebhook(chat, completedAt, processing, quotaExhaustion, responseComplete, previousCompletion, turnLost, stopped) {
|
|
63975
63986
|
const linearSessionId = ENGINE_ENV.REPLICAS_LINEAR_SESSION_ID;
|
|
63976
63987
|
const errors = chat.persisted.parentChatId === null ? chat.lastTurnErrors : null;
|
|
63977
63988
|
chat.lastTurnErrors = null;
|
|
@@ -64004,6 +64015,7 @@ ${note}`;
|
|
|
64004
64015
|
...errors?.length ? { errors } : {},
|
|
64005
64016
|
...notices.length ? { notices } : {},
|
|
64006
64017
|
...turnLost ? { turnLost } : {},
|
|
64018
|
+
...stopped ? { stopped } : {},
|
|
64007
64019
|
...(errors?.length || notices.length || quotaExhaustion) && errorNotificationTargets.length > 0 ? { errorNotificationTargets } : {},
|
|
64008
64020
|
...quotaExhaustion ? { quotaExhaustion } : {},
|
|
64009
64021
|
...isPullRequestFeedbackChat(chat.persisted) ? { pullRequestFeedback: true } : {}
|
|
@@ -65400,8 +65412,8 @@ function createV1Routes(deps) {
|
|
|
65400
65412
|
});
|
|
65401
65413
|
app2.post("/chats/:chatId/interrupt", async (c) => {
|
|
65402
65414
|
try {
|
|
65403
|
-
const { stoppedAt } =
|
|
65404
|
-
const result = await deps.chatService.interrupt(c.req.param("chatId"), stoppedAt);
|
|
65415
|
+
const { stoppedAt, stopped } = engineInterruptChatRequestSchema.catch({}).parse(await c.req.json().catch(() => ({})));
|
|
65416
|
+
const result = await deps.chatService.interrupt(c.req.param("chatId"), stoppedAt, stopped);
|
|
65405
65417
|
const response = result;
|
|
65406
65418
|
return c.json(response);
|
|
65407
65419
|
} catch (error) {
|
|
@@ -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-ZN4BSDP7.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-PHNKPAWA.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