replicas-engine 0.1.856 → 0.1.858
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-AUIMJUCY.js → asp-host-5YQXTWFE.js} +4 -4
- package/dist/src/{chunk-RZ624RCY.js → chunk-BSU4NUZ6.js} +2 -2
- package/dist/src/{chunk-MI3FGOJ5.js → chunk-CIIKJSMK.js} +1 -1
- package/dist/src/{chunk-MXCUMUZM.js → chunk-PU553XRF.js} +1 -1
- package/dist/src/{chunk-JI4KYWFU.js → chunk-SKZCZTT6.js} +5 -5
- package/dist/src/{chunk-XUBRDOMD.js → chunk-U2ZVUWBP.js} +2 -2
- package/dist/src/command-protection-hook.js +3 -3
- package/dist/src/deepseek-command-protection-plugin.js +4 -4
- package/dist/src/headless-agent.js +2 -2
- package/dist/src/index.js +66 -42
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/relay-mcp.js +1 -1
- package/package.json +1 -1
- /package/dist/src/{chunk-NNZ66E66.js → chunk-DWAYLUYH.js} +0 -0
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
getCodexAspHost,
|
|
6
6
|
restartCodexAspHost,
|
|
7
7
|
restartCodexAspHostIfRunning
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-SKZCZTT6.js";
|
|
9
|
+
import "./chunk-PU553XRF.js";
|
|
10
|
+
import "./chunk-BSU4NUZ6.js";
|
|
11
11
|
import "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-DWAYLUYH.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
export {
|
|
15
15
|
getCodexAspHost,
|
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
HOOK_EXEC_MAX_BUFFER_BYTES,
|
|
6
6
|
isVersionBelow
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DWAYLUYH.js";
|
|
8
8
|
|
|
9
9
|
// src/utils/codex-agent-env.ts
|
|
10
10
|
function buildCodexAgentEnv(source = process.env) {
|
|
@@ -241,7 +241,7 @@ var DEFAULT_CODEX_ARGS = [
|
|
|
241
241
|
var MIN_CODEX_CLI_VERSION = "0.153.3";
|
|
242
242
|
var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
|
|
243
243
|
var codexCliVersionEnsured = null;
|
|
244
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
244
|
+
var ENGINE_PACKAGE_VERSION = "0.1.858";
|
|
245
245
|
var INITIALIZE_METHOD = "initialize";
|
|
246
246
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
247
247
|
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
|
shouldRefreshPullRequests
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DWAYLUYH.js";
|
|
7
7
|
|
|
8
8
|
// src/services/post-tool-pr-notifier.ts
|
|
9
9
|
async function notifyPostToolUse(toolName, toolInput) {
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
ENGINE_ENV,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
setAgentCredentialSnapshot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PU553XRF.js";
|
|
9
9
|
import {
|
|
10
10
|
AppServerProcess,
|
|
11
11
|
SUBPROCESS_MAX_BUFFER,
|
|
12
12
|
buildCodexAgentEnv,
|
|
13
13
|
execFileAsync
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-BSU4NUZ6.js";
|
|
15
15
|
import {
|
|
16
16
|
isRecord
|
|
17
17
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
createSuccessResult,
|
|
24
24
|
listOpenAICompatibleModels,
|
|
25
25
|
resolveOpenAICompatibleModelsUrl
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-DWAYLUYH.js";
|
|
27
27
|
|
|
28
28
|
// src/managers/codex-token-manager.ts
|
|
29
29
|
import { promises as fs } from "fs";
|
|
@@ -244,7 +244,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
244
244
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
245
245
|
await this.applyCredentialsResponse(data);
|
|
246
246
|
if (data.scope) setAgentCredentialSnapshot("codex", { method: data.type, scope: data.scope, revision: data.revision });
|
|
247
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
247
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-5YQXTWFE.js");
|
|
248
248
|
await restartCodexAspHostIfRunning2();
|
|
249
249
|
});
|
|
250
250
|
await this.start(true);
|
|
@@ -264,7 +264,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
264
264
|
await this.applyCredentialUpdate(generation, async () => {
|
|
265
265
|
await this.applyCredentialsResponse(data);
|
|
266
266
|
if (restartOnChange && CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index])) {
|
|
267
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
267
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-5YQXTWFE.js");
|
|
268
268
|
await restartCodexAspHostIfRunning2();
|
|
269
269
|
}
|
|
270
270
|
if (data.scope) {
|
|
@@ -3,12 +3,12 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
monolithRequest
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PU553XRF.js";
|
|
7
7
|
import {
|
|
8
8
|
extractCommandProtectionCommandText,
|
|
9
9
|
findGitCommitSignals,
|
|
10
10
|
findPrMergeSignals
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DWAYLUYH.js";
|
|
12
12
|
|
|
13
13
|
// src/services/command-protection-service.ts
|
|
14
14
|
var DEFAULT_COMMAND_PROTECTION_BLOCK_MESSAGE = "Blocked by Replicas command protection.";
|
|
@@ -3,12 +3,12 @@ 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-
|
|
6
|
+
} from "./chunk-U2ZVUWBP.js";
|
|
7
|
+
import "./chunk-PU553XRF.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord
|
|
10
10
|
} from "./chunk-UZSNFLDQ.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-DWAYLUYH.js";
|
|
12
12
|
import "./chunk-VEQXQN22.js";
|
|
13
13
|
|
|
14
14
|
// src/command-protection-hook.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-
|
|
6
|
+
} from "./chunk-U2ZVUWBP.js";
|
|
7
7
|
import {
|
|
8
8
|
notifyPostToolUse
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-CIIKJSMK.js";
|
|
10
|
+
import "./chunk-PU553XRF.js";
|
|
11
11
|
import "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-DWAYLUYH.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/deepseek-command-protection-plugin.ts
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
AppServerProcess,
|
|
10
10
|
buildCodexAgentEnv
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BSU4NUZ6.js";
|
|
12
12
|
import {
|
|
13
13
|
AGENT,
|
|
14
14
|
getMemoryOutputSafetyViolation,
|
|
15
15
|
headlessAgentRequestSchema
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-DWAYLUYH.js";
|
|
17
17
|
import "./chunk-VEQXQN22.js";
|
|
18
18
|
|
|
19
19
|
// src/headless-agent.ts
|
package/dist/src/index.js
CHANGED
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
evaluateCommandProtection,
|
|
92
92
|
extractToolCommand,
|
|
93
93
|
reportCommandProtectionBlock
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-U2ZVUWBP.js";
|
|
95
95
|
import {
|
|
96
96
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
97
97
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -132,20 +132,20 @@ import {
|
|
|
132
132
|
recordCredentialFallback,
|
|
133
133
|
recordExhaustedCredential,
|
|
134
134
|
restartCodexAspHost
|
|
135
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-SKZCZTT6.js";
|
|
136
136
|
import {
|
|
137
137
|
ENGINE_ENV,
|
|
138
138
|
IS_WARMING_MODE,
|
|
139
139
|
monolithRequest,
|
|
140
140
|
monolithService,
|
|
141
141
|
setAgentCredentialSnapshot
|
|
142
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-PU553XRF.js";
|
|
143
143
|
import {
|
|
144
144
|
AspClient,
|
|
145
145
|
SUBPROCESS_MAX_BUFFER,
|
|
146
146
|
execAsync,
|
|
147
147
|
execFileAsync
|
|
148
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-BSU4NUZ6.js";
|
|
149
149
|
import {
|
|
150
150
|
isRecord as isRecord2
|
|
151
151
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -359,7 +359,7 @@ import {
|
|
|
359
359
|
waitRelaySubagentRequestSchema,
|
|
360
360
|
withTimeout,
|
|
361
361
|
workspaceCredentialProviderSchema
|
|
362
|
-
} from "./chunk-
|
|
362
|
+
} from "./chunk-DWAYLUYH.js";
|
|
363
363
|
import {
|
|
364
364
|
__commonJS,
|
|
365
365
|
__export,
|
|
@@ -10707,7 +10707,7 @@ import { join as join36 } from "path";
|
|
|
10707
10707
|
import { randomUUID as randomUUID13 } from "crypto";
|
|
10708
10708
|
|
|
10709
10709
|
// ../shared/src/workspace-chat.ts
|
|
10710
|
-
var WORKSPACE_CHATS_QUERY_SCHEMA_VERSION =
|
|
10710
|
+
var WORKSPACE_CHATS_QUERY_SCHEMA_VERSION = 5;
|
|
10711
10711
|
var WORKSPACE_CHATS_QUERY_ROOT = `workspace-chats:v${WORKSPACE_CHATS_QUERY_SCHEMA_VERSION}`;
|
|
10712
10712
|
function isAcceptedUserMessage(event) {
|
|
10713
10713
|
return getUserMessage(event) !== null && event.payload.source === ACCEPTED_USER_MESSAGE_SOURCE;
|
|
@@ -11701,6 +11701,7 @@ var CodingAgentManager = class {
|
|
|
11701
11701
|
onUsageUpdate;
|
|
11702
11702
|
isRelay;
|
|
11703
11703
|
relayParentChatId;
|
|
11704
|
+
linearSessionId;
|
|
11704
11705
|
hostOnTurnComplete;
|
|
11705
11706
|
onProcessingChanged;
|
|
11706
11707
|
onMessageStarted;
|
|
@@ -11716,6 +11717,7 @@ var CodingAgentManager = class {
|
|
|
11716
11717
|
});
|
|
11717
11718
|
this.relayParentChatId = options.relayParentChatId;
|
|
11718
11719
|
this.isRelay = Boolean(options.relayParentChatId);
|
|
11720
|
+
this.linearSessionId = options.linearSessionId;
|
|
11719
11721
|
this.additionalInstructions = options.additionalInstructions;
|
|
11720
11722
|
this.hostOnTurnComplete = options.onTurnComplete;
|
|
11721
11723
|
this.onProcessingChanged = options.onProcessingChanged ?? (() => {
|
|
@@ -11956,7 +11958,7 @@ var CodingAgentManager = class {
|
|
|
11956
11958
|
return parts.length > 0 ? parts.join("\n\n") : void 0;
|
|
11957
11959
|
}
|
|
11958
11960
|
emitInterruptedQueueEvent(queue) {
|
|
11959
|
-
const linearSessionId =
|
|
11961
|
+
const linearSessionId = this.linearSessionId;
|
|
11960
11962
|
if (!linearSessionId || queue.length === 0) {
|
|
11961
11963
|
return;
|
|
11962
11964
|
}
|
|
@@ -13507,7 +13509,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13507
13509
|
this.activePromptStream = promptStream;
|
|
13508
13510
|
this.activeSessionSignature = signature;
|
|
13509
13511
|
this.activeSessionModel = claudeCodeModel;
|
|
13510
|
-
this.sessionLinearForwarder = new LinearEventForwarder(
|
|
13512
|
+
this.sessionLinearForwarder = new LinearEventForwarder(this.linearSessionId);
|
|
13511
13513
|
this.sessionLoop = this.runSessionLoop(response).catch((err) => {
|
|
13512
13514
|
console.error("[ClaudeManager] Session loop crashed:", err);
|
|
13513
13515
|
});
|
|
@@ -13518,7 +13520,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13518
13520
|
});
|
|
13519
13521
|
}
|
|
13520
13522
|
async runSessionLoop(response) {
|
|
13521
|
-
const linearSessionId =
|
|
13523
|
+
const linearSessionId = this.linearSessionId;
|
|
13522
13524
|
const iterator = response[Symbol.asyncIterator]();
|
|
13523
13525
|
let loopError = null;
|
|
13524
13526
|
let suppressLinearResponseFlush = false;
|
|
@@ -15439,7 +15441,7 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
15439
15441
|
let goalContinuationTimer = null;
|
|
15440
15442
|
const completedItems = [];
|
|
15441
15443
|
const agentMessageDeltas = /* @__PURE__ */ new Map();
|
|
15442
|
-
const linearSessionId =
|
|
15444
|
+
const linearSessionId = this.linearSessionId;
|
|
15443
15445
|
const model = request.model ?? DEFAULT_MODEL;
|
|
15444
15446
|
let tempImagePaths = [];
|
|
15445
15447
|
const linearForwarder = new LinearEventForwarder(linearSessionId);
|
|
@@ -16613,7 +16615,7 @@ var CursorManager = class extends CodingAgentManager {
|
|
|
16613
16615
|
const aborted = new Promise((resolve7) => {
|
|
16614
16616
|
this.abortActiveTurn = () => resolve7(TURN_ABORTED);
|
|
16615
16617
|
});
|
|
16616
|
-
const linearSessionId =
|
|
16618
|
+
const linearSessionId = this.linearSessionId;
|
|
16617
16619
|
const linearForwarder = new LinearEventForwarder(linearSessionId);
|
|
16618
16620
|
const clearReconnectNoticeTimer = () => {
|
|
16619
16621
|
if (!reconnectNoticeTimer) return;
|
|
@@ -18894,7 +18896,7 @@ var OpencodeManager = class extends CodingAgentManager {
|
|
|
18894
18896
|
async processMessageInternal(request) {
|
|
18895
18897
|
const provider = await getOpencodeProvider();
|
|
18896
18898
|
const controller = new AbortController();
|
|
18897
|
-
const linearSessionId =
|
|
18899
|
+
const linearSessionId = this.linearSessionId;
|
|
18898
18900
|
const linearForwarder = new LinearEventForwarder(linearSessionId);
|
|
18899
18901
|
this.handledAccountRateLimit = false;
|
|
18900
18902
|
this.activeAbortController = controller;
|
|
@@ -19079,7 +19081,7 @@ var OpencodeManager = class extends CodingAgentManager {
|
|
|
19079
19081
|
return false;
|
|
19080
19082
|
}
|
|
19081
19083
|
forwardOpencodePartToLinear(part) {
|
|
19082
|
-
const linearSessionId =
|
|
19084
|
+
const linearSessionId = this.linearSessionId;
|
|
19083
19085
|
if (!linearSessionId || !this.activeLinearForwarder) return;
|
|
19084
19086
|
const event = convertOpencodePart(part, linearSessionId);
|
|
19085
19087
|
if (!event) return;
|
|
@@ -61643,7 +61645,7 @@ function hasActiveAgentWork(chat) {
|
|
|
61643
61645
|
return chat.provider.isProcessing() || (chat.provider.hasActiveBackgroundTasks?.() ?? false) || isForkPreparing(chat);
|
|
61644
61646
|
}
|
|
61645
61647
|
function hasActiveChatTurn(chat) {
|
|
61646
|
-
return chat.hasActiveTurn || chat.pendingMessageIds.length > 0 || (chat
|
|
61648
|
+
return chat.hasActiveTurn || chat.pendingMessageIds.length > 0 || hasActiveAgentWork(chat);
|
|
61647
61649
|
}
|
|
61648
61650
|
function isPersistedChat(value) {
|
|
61649
61651
|
if (!isRecord2(value)) {
|
|
@@ -62247,6 +62249,7 @@ var ChatService = class {
|
|
|
62247
62249
|
await this.publish({ type: "chat.deleted", payload: { chatId: id, chat: this.toSummary(target) } });
|
|
62248
62250
|
}
|
|
62249
62251
|
await this.persistAllChats();
|
|
62252
|
+
this.notifyWorkspaceAgentIdle();
|
|
62250
62253
|
}
|
|
62251
62254
|
async restoreChat(chatId) {
|
|
62252
62255
|
const chat = this.chats.get(chatId);
|
|
@@ -62522,13 +62525,7 @@ var ChatService = class {
|
|
|
62522
62525
|
const onMessageStarted = (message) => this.handleTurnStarted(persisted.id, message);
|
|
62523
62526
|
const onProcessingChanged = (processing) => {
|
|
62524
62527
|
if (processing) return;
|
|
62525
|
-
|
|
62526
|
-
if (!chat) return;
|
|
62527
|
-
this.publish({
|
|
62528
|
-
type: "chat.updated",
|
|
62529
|
-
payload: { chat: this.toSummary(chat) }
|
|
62530
|
-
}).catch(() => {
|
|
62531
|
-
});
|
|
62528
|
+
this.handleProcessingStopped(persisted.id);
|
|
62532
62529
|
};
|
|
62533
62530
|
const fallbackContext = () => {
|
|
62534
62531
|
const chat = this.chats.get(persisted.id);
|
|
@@ -62558,6 +62555,7 @@ var ChatService = class {
|
|
|
62558
62555
|
onUsageUpdate: onProviderUsage,
|
|
62559
62556
|
fallbackContext,
|
|
62560
62557
|
additionalInstructions,
|
|
62558
|
+
linearSessionId: persisted.parentChatId === null ? ENGINE_ENV.REPLICAS_LINEAR_SESSION_ID : void 0,
|
|
62561
62559
|
...persisted.provider === "relay" ? { relayParentChatId: persisted.id } : {}
|
|
62562
62560
|
};
|
|
62563
62561
|
let provider;
|
|
@@ -62763,6 +62761,13 @@ var ChatService = class {
|
|
|
62763
62761
|
});
|
|
62764
62762
|
}
|
|
62765
62763
|
}
|
|
62764
|
+
handleProcessingStopped(chatId) {
|
|
62765
|
+
const chat = this.getRuntimeChat(chatId);
|
|
62766
|
+
if (!chat) return;
|
|
62767
|
+
this.publish({ type: "chat.updated", payload: { chat: this.toSummary(chat) } }).catch(() => {
|
|
62768
|
+
});
|
|
62769
|
+
this.notifyWorkspaceAgentIdle();
|
|
62770
|
+
}
|
|
62766
62771
|
endTrackedTurn(chatId) {
|
|
62767
62772
|
this.agentTokenUsageTracker.endTurn(chatId);
|
|
62768
62773
|
this.agentChatActivityTrackerService.noteTurnEnded(chatId);
|
|
@@ -62782,18 +62787,7 @@ var ChatService = class {
|
|
|
62782
62787
|
this.endTrackedTurn(chatId);
|
|
62783
62788
|
const completedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
62784
62789
|
const processing = chat.provider.getQueue().length > 0 || (chat.provider.hasActiveBackgroundTasks?.() ?? false);
|
|
62785
|
-
this.
|
|
62786
|
-
type: "chat.turn.completed",
|
|
62787
|
-
payload: {
|
|
62788
|
-
chatId,
|
|
62789
|
-
isComplete: true,
|
|
62790
|
-
processing,
|
|
62791
|
-
completedAt
|
|
62792
|
-
}
|
|
62793
|
-
}).catch(() => {
|
|
62794
|
-
});
|
|
62795
|
-
monolithService.sendEvent({ type: "agent_response_complete", payload: { completedAt, processing } }).catch(() => {
|
|
62796
|
-
});
|
|
62790
|
+
this.publishTurnCompleted(chat, completedAt, processing);
|
|
62797
62791
|
uploadChatTranscript(
|
|
62798
62792
|
chatId,
|
|
62799
62793
|
join36(HISTORY_DIR_BY_PROVIDER[chat.persisted.provider], `${chatId}.jsonl`),
|
|
@@ -62812,6 +62806,31 @@ var ChatService = class {
|
|
|
62812
62806
|
console.error("[ChatService] Automatic fork after quota limit failed:", { chatId, error });
|
|
62813
62807
|
});
|
|
62814
62808
|
}
|
|
62809
|
+
this.notifyWorkspaceAgentIdle();
|
|
62810
|
+
}
|
|
62811
|
+
publishTurnCompleted(chat, completedAt, processing) {
|
|
62812
|
+
if (chat.persisted.parentChatId) {
|
|
62813
|
+
this.publish({ type: "chat.updated", payload: { chat: this.toSummary(chat) } }).catch(() => {
|
|
62814
|
+
});
|
|
62815
|
+
return;
|
|
62816
|
+
}
|
|
62817
|
+
this.publish({
|
|
62818
|
+
type: "chat.turn.completed",
|
|
62819
|
+
payload: {
|
|
62820
|
+
chatId: chat.persisted.id,
|
|
62821
|
+
isComplete: true,
|
|
62822
|
+
processing,
|
|
62823
|
+
completedAt
|
|
62824
|
+
}
|
|
62825
|
+
}).catch(() => {
|
|
62826
|
+
});
|
|
62827
|
+
monolithService.sendEvent({ type: "agent_response_complete", payload: { completedAt, processing } }).catch(() => {
|
|
62828
|
+
});
|
|
62829
|
+
}
|
|
62830
|
+
notifyWorkspaceAgentIdle() {
|
|
62831
|
+
if (this.getProcessingCount() > 0) return;
|
|
62832
|
+
monolithService.sendEvent({ type: "workspace_agent_idle", payload: {} }).catch(() => {
|
|
62833
|
+
});
|
|
62815
62834
|
}
|
|
62816
62835
|
getRuntimeChat(chatId) {
|
|
62817
62836
|
const chat = this.chats.get(chatId) ?? null;
|
|
@@ -62893,19 +62912,12 @@ var ChatService = class {
|
|
|
62893
62912
|
}
|
|
62894
62913
|
async publishAgentTurnCompleteWebhook(chat, completedAt, processing = false) {
|
|
62895
62914
|
const linearSessionId = ENGINE_ENV.REPLICAS_LINEAR_SESSION_ID;
|
|
62896
|
-
const observedBranches = chat.observedBranchesByRepo;
|
|
62897
|
-
chat.observedBranchesByRepo = /* @__PURE__ */ new Map();
|
|
62898
62915
|
const errors = chat.persisted.parentChatId === null ? chat.lastTurnErrors : null;
|
|
62899
62916
|
chat.lastTurnErrors = null;
|
|
62900
62917
|
const errorNotificationTarget = chat.activeErrorNotificationTarget;
|
|
62901
62918
|
chat.activeErrorNotificationTarget = null;
|
|
62902
|
-
|
|
62903
|
-
|
|
62904
|
-
repoStatuses = await refreshRepoStatuses(observedBranches, true);
|
|
62905
|
-
console.log(`Repository Statuses Refreshed: `, repoStatuses);
|
|
62906
|
-
} catch (error) {
|
|
62907
|
-
console.error("[ChatService] Failed to refresh repo statuses:", error);
|
|
62908
|
-
}
|
|
62919
|
+
const repoStatuses = await this.refreshTurnRepos(chat);
|
|
62920
|
+
if (chat.persisted.parentChatId) return;
|
|
62909
62921
|
try {
|
|
62910
62922
|
const payload = {
|
|
62911
62923
|
...linearSessionId ? { linearSessionId } : {},
|
|
@@ -62920,6 +62932,18 @@ var ChatService = class {
|
|
|
62920
62932
|
console.error("[ChatService] Failed to send agent_turn_complete event:", error);
|
|
62921
62933
|
}
|
|
62922
62934
|
}
|
|
62935
|
+
async refreshTurnRepos(chat) {
|
|
62936
|
+
const observedBranches = chat.observedBranchesByRepo;
|
|
62937
|
+
chat.observedBranchesByRepo = /* @__PURE__ */ new Map();
|
|
62938
|
+
try {
|
|
62939
|
+
const repoStatuses = await refreshRepoStatuses(observedBranches, true);
|
|
62940
|
+
console.log(`Repository Statuses Refreshed: `, repoStatuses);
|
|
62941
|
+
return repoStatuses;
|
|
62942
|
+
} catch (error) {
|
|
62943
|
+
console.error("[ChatService] Failed to refresh repo statuses:", error);
|
|
62944
|
+
return [];
|
|
62945
|
+
}
|
|
62946
|
+
}
|
|
62923
62947
|
};
|
|
62924
62948
|
|
|
62925
62949
|
// src/services/repo-file-service.ts
|
|
@@ -3,11 +3,11 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
notifyPostToolUse
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CIIKJSMK.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
9
|
} from "./chunk-UZSNFLDQ.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-DWAYLUYH.js";
|
|
11
11
|
import "./chunk-VEQXQN22.js";
|
|
12
12
|
|
|
13
13
|
// src/post-tool-pr-hook.ts
|
package/dist/src/relay-mcp.js
CHANGED
package/package.json
CHANGED
|
File without changes
|