replicas-engine 0.1.571 → 0.1.573
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/index.js +17 -7
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -3438,6 +3438,13 @@ function findPrMergeSignals(request) {
|
|
|
3438
3438
|
];
|
|
3439
3439
|
return checks.flatMap(([name, pattern]) => pattern.test(combined) ? [name] : []);
|
|
3440
3440
|
}
|
|
3441
|
+
function findGitCommitCommands(command) {
|
|
3442
|
+
return [...command.matchAll(/\bgit(?:\s+-[^\s;&|]+(?:\s+(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s;&|]+))?)*\s+commit\b(?:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\\\r?\n|[^;&|\r\n])*)/g)].map((match) => match[0]);
|
|
3443
|
+
}
|
|
3444
|
+
function findGitCommitSignals(request) {
|
|
3445
|
+
const command = extractCommandProtectionCommandText(request, { stringifyFallback: true }) ?? "";
|
|
3446
|
+
return findGitCommitCommands(command).length > 0 ? ["git-commit"] : [];
|
|
3447
|
+
}
|
|
3441
3448
|
|
|
3442
3449
|
// ../shared/src/routes/client-state.ts
|
|
3443
3450
|
var MAX_CLIENT_STATE_REQUEST_BYTES = 5 * 1024 * 1024;
|
|
@@ -5139,7 +5146,7 @@ function messageForItem(item) {
|
|
|
5139
5146
|
};
|
|
5140
5147
|
}
|
|
5141
5148
|
if (item.type === "reasoning") {
|
|
5142
|
-
if (!item.text
|
|
5149
|
+
if (!item.text) return null;
|
|
5143
5150
|
return {
|
|
5144
5151
|
id: `reasoning-${item.id}`,
|
|
5145
5152
|
type: "reasoning",
|
|
@@ -9012,7 +9019,7 @@ function failClosed(reason, matchedSignals) {
|
|
|
9012
9019
|
};
|
|
9013
9020
|
}
|
|
9014
9021
|
async function evaluateCommandProtection(request, signal) {
|
|
9015
|
-
const matchedSignals = findPrMergeSignals(request);
|
|
9022
|
+
const matchedSignals = [...findGitCommitSignals(request), ...findPrMergeSignals(request)];
|
|
9016
9023
|
if (matchedSignals.length === 0) {
|
|
9017
9024
|
return { allowed: true, enabled: true };
|
|
9018
9025
|
}
|
|
@@ -10780,7 +10787,7 @@ var DEFAULT_CODEX_ARGS = ["app-server", "--listen", "stdio://"];
|
|
|
10780
10787
|
var MIN_CODEX_CLI_VERSION = "0.144.6";
|
|
10781
10788
|
var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
|
|
10782
10789
|
var codexCliVersionEnsured = null;
|
|
10783
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
10790
|
+
var ENGINE_PACKAGE_VERSION = "0.1.573";
|
|
10784
10791
|
var INITIALIZE_METHOD = "initialize";
|
|
10785
10792
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
10786
10793
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -16554,16 +16561,18 @@ var ChatService = class {
|
|
|
16554
16561
|
chat.hasActiveTurn = false;
|
|
16555
16562
|
chat.activeMessageId = null;
|
|
16556
16563
|
this.analyticsService.noteTurnEnded(chatId);
|
|
16564
|
+
const completedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
16557
16565
|
this.publish({
|
|
16558
16566
|
type: "chat.turn.completed",
|
|
16559
16567
|
payload: {
|
|
16560
16568
|
chatId,
|
|
16561
16569
|
isComplete: true,
|
|
16562
|
-
processing: chat.provider.hasActiveBackgroundTasks?.() ?? false
|
|
16570
|
+
processing: chat.provider.hasActiveBackgroundTasks?.() ?? false,
|
|
16571
|
+
completedAt
|
|
16563
16572
|
}
|
|
16564
16573
|
}).catch(() => {
|
|
16565
16574
|
});
|
|
16566
|
-
monolithService.sendEvent({ type: "agent_response_complete", payload: {} }).catch(() => {
|
|
16575
|
+
monolithService.sendEvent({ type: "agent_response_complete", payload: { completedAt } }).catch(() => {
|
|
16567
16576
|
});
|
|
16568
16577
|
uploadChatTranscript(
|
|
16569
16578
|
chatId,
|
|
@@ -16575,7 +16584,7 @@ var ChatService = class {
|
|
|
16575
16584
|
flushAllCanvasItems().catch((err) => {
|
|
16576
16585
|
console.error("[ChatService] Failed to upload canvas items:", { chatId, err });
|
|
16577
16586
|
});
|
|
16578
|
-
await this.publishAgentTurnCompleteWebhook(chat);
|
|
16587
|
+
await this.publishAgentTurnCompleteWebhook(chat, completedAt);
|
|
16579
16588
|
}
|
|
16580
16589
|
getRuntimeChat(chatId) {
|
|
16581
16590
|
const chat = this.chats.get(chatId) ?? null;
|
|
@@ -16657,7 +16666,7 @@ var ChatService = class {
|
|
|
16657
16666
|
} catch {
|
|
16658
16667
|
}
|
|
16659
16668
|
}
|
|
16660
|
-
async publishAgentTurnCompleteWebhook(chat) {
|
|
16669
|
+
async publishAgentTurnCompleteWebhook(chat, completedAt) {
|
|
16661
16670
|
await Promise.all([
|
|
16662
16671
|
githubTokenManager.refreshOnce().catch(() => {
|
|
16663
16672
|
}),
|
|
@@ -16689,6 +16698,7 @@ var ChatService = class {
|
|
|
16689
16698
|
try {
|
|
16690
16699
|
const payload = {
|
|
16691
16700
|
...linearSessionId ? { linearSessionId } : {},
|
|
16701
|
+
...completedAt ? { completedAt } : {},
|
|
16692
16702
|
repoStatuses,
|
|
16693
16703
|
...errors?.length ? { errors } : {},
|
|
16694
16704
|
...errors?.length && errorNotificationTarget ? { errorNotificationTarget } : {}
|