replicas-engine 0.1.857 → 0.1.859
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-PJEJIX73.js → asp-host-RBVPAQAX.js} +4 -4
- package/dist/src/{chunk-NNZ66E66.js → chunk-CJYHREYR.js} +12 -51
- package/dist/src/{chunk-MI3FGOJ5.js → chunk-DCSIVHOX.js} +1 -1
- package/dist/src/{chunk-MXCUMUZM.js → chunk-DQRRHUUI.js} +1 -1
- package/dist/src/{chunk-XUBRDOMD.js → chunk-N6SW5DW5.js} +2 -2
- package/dist/src/{chunk-TNY3INWD.js → chunk-V4CYDVUF.js} +2 -2
- package/dist/src/{chunk-F5APBLRA.js → chunk-Z4VKDKA4.js} +5 -5
- 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 +16 -86
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/relay-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -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-Z4VKDKA4.js";
|
|
9
|
+
import "./chunk-DQRRHUUI.js";
|
|
10
|
+
import "./chunk-V4CYDVUF.js";
|
|
11
11
|
import "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-CJYHREYR.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
export {
|
|
15
15
|
getCodexAspHost,
|
|
@@ -1022,35 +1022,6 @@ var CONTEXT_USAGE_EVENT_TYPE = "context-usage";
|
|
|
1022
1022
|
// ../shared/src/engine/v1.ts
|
|
1023
1023
|
import { z as z3 } from "zod";
|
|
1024
1024
|
var MERGED_MESSAGE_SEPARATOR = "\n\n<!-- replicas:merged -->\n\n";
|
|
1025
|
-
function isChatScopedEngineEvent(event) {
|
|
1026
|
-
return event.type.startsWith("chat.");
|
|
1027
|
-
}
|
|
1028
|
-
function getChatScopedEngineEventChatId(event) {
|
|
1029
|
-
return event.type === "chat.created" || event.type === "chat.updated" ? event.payload.chat.id : event.payload.chatId;
|
|
1030
|
-
}
|
|
1031
|
-
var CHAT_STREAM_RESYNC_EVENT_TYPE = "chat.stream.resync";
|
|
1032
|
-
var CHAT_STREAM_READY_EVENT_TYPE = "chat.stream.ready";
|
|
1033
|
-
var chatEventSubscriptionsSchema = z3.object({
|
|
1034
|
-
chats: z3.array(z3.object({
|
|
1035
|
-
workspaceId: z3.string().uuid(),
|
|
1036
|
-
chatId: z3.string().min(1).max(256),
|
|
1037
|
-
after: z3.string().regex(/^\d+-\d+$/)
|
|
1038
|
-
})).min(1).max(256)
|
|
1039
|
-
});
|
|
1040
|
-
function isChatStreamEvent(value) {
|
|
1041
|
-
return isRecord(value) && typeof value.id === "string" && typeof value.ts === "string" && typeof value.type === "string" && value.type.startsWith("chat.") && isRecord(value.payload);
|
|
1042
|
-
}
|
|
1043
|
-
var ENGINE_CHAT_EVENTS_PUSH_MAX_EVENTS = 500;
|
|
1044
|
-
var chatScopedEngineEventSchema = z3.custom(
|
|
1045
|
-
(value) => isChatStreamEvent(value) && value.type !== CHAT_STREAM_RESYNC_EVENT_TYPE && value.type !== CHAT_STREAM_READY_EVENT_TYPE
|
|
1046
|
-
);
|
|
1047
|
-
var engineChatEventsPushRequestSchema = z3.object({
|
|
1048
|
-
epoch: z3.string().min(1).max(64),
|
|
1049
|
-
events: z3.array(z3.object({
|
|
1050
|
-
seq: z3.number().int().positive(),
|
|
1051
|
-
event: chatScopedEngineEventSchema
|
|
1052
|
-
})).max(ENGINE_CHAT_EVENTS_PUSH_MAX_EVENTS)
|
|
1053
|
-
});
|
|
1054
1025
|
var ENGINE_HEALTH_WAIT_HEADER = "X-Replicas-Health-Wait";
|
|
1055
1026
|
var ENGINE_HEALTH_WAIT_QUERY_PARAM = "wait_ms";
|
|
1056
1027
|
var ENGINE_HEALTH_MAX_WAIT_MS = 2e3;
|
|
@@ -1651,17 +1622,14 @@ var DESKTOP_STREAM_PORT = 6080;
|
|
|
1651
1622
|
// ../shared/src/sse.ts
|
|
1652
1623
|
function parseSseChunk(chunk) {
|
|
1653
1624
|
let data = "";
|
|
1654
|
-
let id = null;
|
|
1655
1625
|
for (const line of chunk.split("\n")) {
|
|
1656
1626
|
if (line.startsWith("data: ")) {
|
|
1657
1627
|
data += line.slice(6);
|
|
1658
|
-
} else if (line.startsWith("id: ")) {
|
|
1659
|
-
id = line.slice(4);
|
|
1660
1628
|
}
|
|
1661
1629
|
}
|
|
1662
1630
|
if (!data) return null;
|
|
1663
1631
|
try {
|
|
1664
|
-
return
|
|
1632
|
+
return JSON.parse(data);
|
|
1665
1633
|
} catch {
|
|
1666
1634
|
return null;
|
|
1667
1635
|
}
|
|
@@ -1670,22 +1638,18 @@ async function readSseStream(body, onEvent, shouldContinue = () => true) {
|
|
|
1670
1638
|
const reader = body.getReader();
|
|
1671
1639
|
const decoder2 = new TextDecoder();
|
|
1672
1640
|
let buffer = "";
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
await onEvent(parsed.event, parsed.id);
|
|
1685
|
-
}
|
|
1641
|
+
while (shouldContinue()) {
|
|
1642
|
+
const { done, value } = await reader.read();
|
|
1643
|
+
if (done) break;
|
|
1644
|
+
buffer += decoder2.decode(value, { stream: true });
|
|
1645
|
+
const chunks = buffer.split("\n\n");
|
|
1646
|
+
buffer = chunks.pop() ?? "";
|
|
1647
|
+
for (const chunk of chunks) {
|
|
1648
|
+
if (!shouldContinue()) break;
|
|
1649
|
+
const event = parseSseChunk(chunk);
|
|
1650
|
+
if (!event) continue;
|
|
1651
|
+
await onEvent(event);
|
|
1686
1652
|
}
|
|
1687
|
-
} finally {
|
|
1688
|
-
await reader.cancel().catch(() => void 0);
|
|
1689
1653
|
}
|
|
1690
1654
|
}
|
|
1691
1655
|
|
|
@@ -8019,9 +7983,6 @@ export {
|
|
|
8019
7983
|
coerceChatGoalPayload,
|
|
8020
7984
|
CONTEXT_USAGE_EVENT_TYPE,
|
|
8021
7985
|
MERGED_MESSAGE_SEPARATOR,
|
|
8022
|
-
isChatScopedEngineEvent,
|
|
8023
|
-
getChatScopedEngineEventChatId,
|
|
8024
|
-
ENGINE_CHAT_EVENTS_PUSH_MAX_EVENTS,
|
|
8025
7986
|
ENGINE_HEALTH_WAIT_HEADER,
|
|
8026
7987
|
ENGINE_HEALTH_WAIT_QUERY_PARAM,
|
|
8027
7988
|
ENGINE_HEALTH_MAX_WAIT_MS,
|
|
@@ -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-CJYHREYR.js";
|
|
7
7
|
|
|
8
8
|
// src/services/post-tool-pr-notifier.ts
|
|
9
9
|
async function notifyPostToolUse(toolName, toolInput) {
|
|
@@ -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-DQRRHUUI.js";
|
|
7
7
|
import {
|
|
8
8
|
extractCommandProtectionCommandText,
|
|
9
9
|
findGitCommitSignals,
|
|
10
10
|
findPrMergeSignals
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CJYHREYR.js";
|
|
12
12
|
|
|
13
13
|
// src/services/command-protection-service.ts
|
|
14
14
|
var DEFAULT_COMMAND_PROTECTION_BLOCK_MESSAGE = "Blocked by Replicas command protection.";
|
|
@@ -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-CJYHREYR.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.859";
|
|
245
245
|
var INITIALIZE_METHOD = "initialize";
|
|
246
246
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
247
247
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
ENGINE_ENV,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
setAgentCredentialSnapshot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DQRRHUUI.js";
|
|
9
9
|
import {
|
|
10
10
|
AppServerProcess,
|
|
11
11
|
SUBPROCESS_MAX_BUFFER,
|
|
12
12
|
buildCodexAgentEnv,
|
|
13
13
|
execFileAsync
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-V4CYDVUF.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-CJYHREYR.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-RBVPAQAX.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-RBVPAQAX.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
|
evaluateCommandProtection
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-N6SW5DW5.js";
|
|
7
|
+
import "./chunk-DQRRHUUI.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord
|
|
10
10
|
} from "./chunk-UZSNFLDQ.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-CJYHREYR.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-N6SW5DW5.js";
|
|
7
7
|
import {
|
|
8
8
|
notifyPostToolUse
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-DCSIVHOX.js";
|
|
10
|
+
import "./chunk-DQRRHUUI.js";
|
|
11
11
|
import "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-CJYHREYR.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-V4CYDVUF.js";
|
|
12
12
|
import {
|
|
13
13
|
AGENT,
|
|
14
14
|
getMemoryOutputSafetyViolation,
|
|
15
15
|
headlessAgentRequestSchema
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-CJYHREYR.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-N6SW5DW5.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-Z4VKDKA4.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-DQRRHUUI.js";
|
|
143
143
|
import {
|
|
144
144
|
AspClient,
|
|
145
145
|
SUBPROCESS_MAX_BUFFER,
|
|
146
146
|
execAsync,
|
|
147
147
|
execFileAsync
|
|
148
|
-
} from "./chunk-
|
|
148
|
+
} from "./chunk-V4CYDVUF.js";
|
|
149
149
|
import {
|
|
150
150
|
isRecord as isRecord2
|
|
151
151
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -202,7 +202,6 @@ import {
|
|
|
202
202
|
DEFAULT_RELAY_BASE_PROVIDER,
|
|
203
203
|
DEFAULT_START_HOOK_TIMEOUT_MS,
|
|
204
204
|
DESKTOP_STREAM_PORT,
|
|
205
|
-
ENGINE_CHAT_EVENTS_PUSH_MAX_EVENTS,
|
|
206
205
|
ENGINE_HEALTH_MAX_WAIT_MS,
|
|
207
206
|
ENGINE_HEALTH_WAIT_HEADER,
|
|
208
207
|
ENGINE_HEALTH_WAIT_QUERY_PARAM,
|
|
@@ -277,7 +276,6 @@ import {
|
|
|
277
276
|
getChatExecutionProvider,
|
|
278
277
|
getChatHistoryPageSenders,
|
|
279
278
|
getChatHistoryPageWindow,
|
|
280
|
-
getChatScopedEngineEventChatId,
|
|
281
279
|
getChatTranscriptHistorySize,
|
|
282
280
|
getClaudeModelContextWindow,
|
|
283
281
|
getClaudePartialMessageStreamId,
|
|
@@ -303,7 +301,6 @@ import {
|
|
|
303
301
|
isAuthenticationErrorText,
|
|
304
302
|
isCanvasTextKind,
|
|
305
303
|
isChatMessageSender,
|
|
306
|
-
isChatScopedEngineEvent,
|
|
307
304
|
isClaudeAuthErrorText,
|
|
308
305
|
isClaudeResultError,
|
|
309
306
|
isCodexAspTranscript,
|
|
@@ -359,7 +356,7 @@ import {
|
|
|
359
356
|
waitRelaySubagentRequestSchema,
|
|
360
357
|
withTimeout,
|
|
361
358
|
workspaceCredentialProviderSchema
|
|
362
|
-
} from "./chunk-
|
|
359
|
+
} from "./chunk-CJYHREYR.js";
|
|
363
360
|
import {
|
|
364
361
|
__commonJS,
|
|
365
362
|
__export,
|
|
@@ -8552,7 +8549,7 @@ var require_dist2 = __commonJS({
|
|
|
8552
8549
|
import { serve } from "@hono/node-server";
|
|
8553
8550
|
import { Hono as Hono2 } from "hono";
|
|
8554
8551
|
import { existsSync as existsSync20 } from "fs";
|
|
8555
|
-
import { randomUUID as
|
|
8552
|
+
import { randomUUID as randomUUID15 } from "crypto";
|
|
8556
8553
|
import { connect } from "net";
|
|
8557
8554
|
|
|
8558
8555
|
// src/managers/github-token-manager.ts
|
|
@@ -64981,72 +64978,6 @@ var HeartbeatService = class _HeartbeatService {
|
|
|
64981
64978
|
};
|
|
64982
64979
|
var heartbeatService = new HeartbeatService();
|
|
64983
64980
|
|
|
64984
|
-
// src/services/chat-event-publisher.ts
|
|
64985
|
-
import { randomUUID as randomUUID15 } from "crypto";
|
|
64986
|
-
var FLUSH_DELAY_MS = 100;
|
|
64987
|
-
var REQUEST_TIMEOUT_MS = 1e4;
|
|
64988
|
-
var MAX_QUEUE = 1e4;
|
|
64989
|
-
var INITIAL_BACKOFF_MS = 1e3;
|
|
64990
|
-
var MAX_BACKOFF_MS = 3e4;
|
|
64991
|
-
var ChatEventPublisher = class {
|
|
64992
|
-
epoch = randomUUID15();
|
|
64993
|
-
seqByChat = /* @__PURE__ */ new Map();
|
|
64994
|
-
queue = [];
|
|
64995
|
-
timer = null;
|
|
64996
|
-
flushing = false;
|
|
64997
|
-
backoffMs = INITIAL_BACKOFF_MS;
|
|
64998
|
-
unsupported = false;
|
|
64999
|
-
start() {
|
|
65000
|
-
if (IS_WARMING_MODE || !ENGINE_ENV.REPLICAS_WORKSPACE_ID) return;
|
|
65001
|
-
eventService.subscribe((event) => this.enqueue(event));
|
|
65002
|
-
}
|
|
65003
|
-
enqueue(event) {
|
|
65004
|
-
if (this.unsupported || !isChatScopedEngineEvent(event)) return;
|
|
65005
|
-
const chatId = getChatScopedEngineEventChatId(event);
|
|
65006
|
-
const seq = (this.seqByChat.get(chatId) ?? 0) + 1;
|
|
65007
|
-
this.seqByChat.set(chatId, seq);
|
|
65008
|
-
this.queue.push({ seq, event });
|
|
65009
|
-
if (this.queue.length > MAX_QUEUE) this.queue.splice(0, this.queue.length - MAX_QUEUE);
|
|
65010
|
-
this.schedule(FLUSH_DELAY_MS);
|
|
65011
|
-
}
|
|
65012
|
-
schedule(delayMs) {
|
|
65013
|
-
if (this.timer || this.flushing) return;
|
|
65014
|
-
this.timer = setTimeout(() => {
|
|
65015
|
-
this.timer = null;
|
|
65016
|
-
void this.flush();
|
|
65017
|
-
}, delayMs);
|
|
65018
|
-
this.timer.unref?.();
|
|
65019
|
-
}
|
|
65020
|
-
async flush() {
|
|
65021
|
-
if (this.flushing || this.queue.length === 0) return;
|
|
65022
|
-
this.flushing = true;
|
|
65023
|
-
const batch = this.queue.slice(0, ENGINE_CHAT_EVENTS_PUSH_MAX_EVENTS);
|
|
65024
|
-
try {
|
|
65025
|
-
const body = { epoch: this.epoch, events: batch };
|
|
65026
|
-
const response = await monolithRequest("/v1/engine/chat-events", { body, signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS) });
|
|
65027
|
-
if (response.status === 404) {
|
|
65028
|
-
this.unsupported = true;
|
|
65029
|
-
this.queue = [];
|
|
65030
|
-
return;
|
|
65031
|
-
}
|
|
65032
|
-
if (!response.ok) throw new Error(`chat events push returned ${response.status}`);
|
|
65033
|
-
const lastSentIndex = this.queue.indexOf(batch[batch.length - 1]);
|
|
65034
|
-
this.queue.splice(0, lastSentIndex + 1);
|
|
65035
|
-
this.backoffMs = INITIAL_BACKOFF_MS;
|
|
65036
|
-
} catch (error) {
|
|
65037
|
-
console.warn("[ChatEventPublisher] Push failed:", error instanceof Error ? error.message : error);
|
|
65038
|
-
this.flushing = false;
|
|
65039
|
-
this.schedule(this.backoffMs);
|
|
65040
|
-
this.backoffMs = Math.min(this.backoffMs * 2, MAX_BACKOFF_MS);
|
|
65041
|
-
return;
|
|
65042
|
-
} finally {
|
|
65043
|
-
this.flushing = false;
|
|
65044
|
-
}
|
|
65045
|
-
if (this.queue.length > 0) this.schedule(0);
|
|
65046
|
-
}
|
|
65047
|
-
};
|
|
65048
|
-
var chatEventPublisher = new ChatEventPublisher();
|
|
65049
|
-
|
|
65050
64981
|
// src/services/workspace-sdk-service.ts
|
|
65051
64982
|
import { cp, mkdir as mkdir23 } from "fs/promises";
|
|
65052
64983
|
import { dirname as dirname20, resolve as resolve6 } from "path";
|
|
@@ -65258,7 +65189,7 @@ function startStatusBroadcaster() {
|
|
|
65258
65189
|
if (serialized !== previousRepoStatus) {
|
|
65259
65190
|
previousRepoStatus = serialized;
|
|
65260
65191
|
eventService.publish({
|
|
65261
|
-
id:
|
|
65192
|
+
id: randomUUID15(),
|
|
65262
65193
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
65263
65194
|
type: "repo.status.changed",
|
|
65264
65195
|
payload: { repos }
|
|
@@ -65279,7 +65210,7 @@ function startStatusBroadcaster() {
|
|
|
65279
65210
|
if (engineStatusJson !== previousEngineStatus) {
|
|
65280
65211
|
previousEngineStatus = engineStatusJson;
|
|
65281
65212
|
eventService.publish({
|
|
65282
|
-
id:
|
|
65213
|
+
id: randomUUID15(),
|
|
65283
65214
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
65284
65215
|
type: "engine.status.changed",
|
|
65285
65216
|
payload: { status: engineStatus }
|
|
@@ -65298,7 +65229,7 @@ function startStatusBroadcaster() {
|
|
|
65298
65229
|
previousHookStatus = hookSnapshot;
|
|
65299
65230
|
if (!lastHooksRunning && hooksRunning) {
|
|
65300
65231
|
eventService.publish({
|
|
65301
|
-
id:
|
|
65232
|
+
id: randomUUID15(),
|
|
65302
65233
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
65303
65234
|
type: "hooks.started",
|
|
65304
65235
|
payload: { running: true, completed: false }
|
|
@@ -65307,7 +65238,7 @@ function startStatusBroadcaster() {
|
|
|
65307
65238
|
}
|
|
65308
65239
|
if (hooksRunning) {
|
|
65309
65240
|
eventService.publish({
|
|
65310
|
-
id:
|
|
65241
|
+
id: randomUUID15(),
|
|
65311
65242
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
65312
65243
|
type: "hooks.progress",
|
|
65313
65244
|
payload: { running: true, completed: false }
|
|
@@ -65316,7 +65247,7 @@ function startStatusBroadcaster() {
|
|
|
65316
65247
|
}
|
|
65317
65248
|
if (lastHooksRunning && !hooksRunning && hooksCompleted && !hooksFailed) {
|
|
65318
65249
|
eventService.publish({
|
|
65319
|
-
id:
|
|
65250
|
+
id: randomUUID15(),
|
|
65320
65251
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
65321
65252
|
type: "hooks.completed",
|
|
65322
65253
|
payload: { running: false, completed: true }
|
|
@@ -65325,7 +65256,7 @@ function startStatusBroadcaster() {
|
|
|
65325
65256
|
}
|
|
65326
65257
|
if (lastHooksRunning && !hooksRunning && hooksFailed) {
|
|
65327
65258
|
eventService.publish({
|
|
65328
|
-
id:
|
|
65259
|
+
id: randomUUID15(),
|
|
65329
65260
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
65330
65261
|
type: "hooks.failed",
|
|
65331
65262
|
payload: { running: false, completed: hooksCompleted }
|
|
@@ -65333,7 +65264,7 @@ function startStatusBroadcaster() {
|
|
|
65333
65264
|
});
|
|
65334
65265
|
}
|
|
65335
65266
|
eventService.publish({
|
|
65336
|
-
id:
|
|
65267
|
+
id: randomUUID15(),
|
|
65337
65268
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
65338
65269
|
type: "hooks.status",
|
|
65339
65270
|
payload: {
|
|
@@ -65380,7 +65311,6 @@ serve(
|
|
|
65380
65311
|
resolveEngineReady();
|
|
65381
65312
|
void registerDesktopPreview();
|
|
65382
65313
|
heartbeatService.start(bootTimeMs);
|
|
65383
|
-
chatEventPublisher.start();
|
|
65384
65314
|
if (!IS_WARMING_MODE) {
|
|
65385
65315
|
await gitlabTokenManager.start();
|
|
65386
65316
|
await claudeTokenManager.start();
|
|
@@ -65389,20 +65319,20 @@ serve(
|
|
|
65389
65319
|
}
|
|
65390
65320
|
const repos = await gitService.listRepos();
|
|
65391
65321
|
await eventService.publish({
|
|
65392
|
-
id:
|
|
65322
|
+
id: randomUUID15(),
|
|
65393
65323
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
65394
65324
|
type: "repo.discovered",
|
|
65395
65325
|
payload: { repos }
|
|
65396
65326
|
});
|
|
65397
65327
|
const repoStatuses = await gitService.listRepos();
|
|
65398
65328
|
await eventService.publish({
|
|
65399
|
-
id:
|
|
65329
|
+
id: randomUUID15(),
|
|
65400
65330
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
65401
65331
|
type: "repo.status.changed",
|
|
65402
65332
|
payload: { repos: repoStatuses }
|
|
65403
65333
|
});
|
|
65404
65334
|
await eventService.publish({
|
|
65405
|
-
id:
|
|
65335
|
+
id: randomUUID15(),
|
|
65406
65336
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
65407
65337
|
type: "engine.ready",
|
|
65408
65338
|
payload: { version: "v1" }
|
|
@@ -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-DCSIVHOX.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
9
|
} from "./chunk-UZSNFLDQ.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-CJYHREYR.js";
|
|
11
11
|
import "./chunk-VEQXQN22.js";
|
|
12
12
|
|
|
13
13
|
// src/post-tool-pr-hook.ts
|
package/dist/src/relay-mcp.js
CHANGED