replicas-engine 0.1.882 → 0.1.883
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-AJ55PRBL.js → asp-host-UHA7DQNH.js} +4 -4
- package/dist/src/{chunk-PYQVWR2X.js → chunk-2HBZMD3O.js} +20 -12
- package/dist/src/{chunk-OMPZUIYA.js → chunk-BDG6FRDO.js} +2 -2
- package/dist/src/{chunk-H42KW3RC.js → chunk-EW3NFV6B.js} +5 -5
- package/dist/src/{chunk-4CF465DO.js → chunk-M3A4WF5K.js} +1 -1
- package/dist/src/{chunk-BYRW3S7A.js → chunk-Q3M3WO7E.js} +1 -1
- package/dist/src/{chunk-SFWJXPG3.js → chunk-USCNKCYW.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 +24 -16
- 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-EW3NFV6B.js";
|
|
9
|
+
import "./chunk-M3A4WF5K.js";
|
|
10
|
+
import "./chunk-USCNKCYW.js";
|
|
11
11
|
import "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-2HBZMD3O.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
export {
|
|
15
15
|
getCodexAspHost,
|
|
@@ -1161,6 +1161,24 @@ var relaySubagentResponseSchema = z3.object({
|
|
|
1161
1161
|
response: z3.string().optional(),
|
|
1162
1162
|
timedOut: z3.literal(true).optional()
|
|
1163
1163
|
});
|
|
1164
|
+
var integrationErrorNotificationTargetSchema = z3.discriminatedUnion("type", [
|
|
1165
|
+
z3.object({
|
|
1166
|
+
type: z3.literal("slack"),
|
|
1167
|
+
conversation: z3.object({
|
|
1168
|
+
channelId: z3.string().min(1),
|
|
1169
|
+
threadTs: z3.string().min(1)
|
|
1170
|
+
}).optional()
|
|
1171
|
+
}),
|
|
1172
|
+
z3.object({ type: z3.literal("linear"), sessionId: z3.string().min(1) }),
|
|
1173
|
+
z3.object({
|
|
1174
|
+
type: z3.literal("code_host"),
|
|
1175
|
+
provider: z3.enum(["github", "gitlab"]),
|
|
1176
|
+
resource: z3.enum(["issue", "pull_request"]),
|
|
1177
|
+
repositoryId: z3.string().min(1),
|
|
1178
|
+
resourceNumber: z3.number().int().positive()
|
|
1179
|
+
}),
|
|
1180
|
+
z3.object({ type: z3.literal("automation"), executionId: z3.string().min(1) })
|
|
1181
|
+
]);
|
|
1164
1182
|
var sendChatMessageRequestSchema = z3.object({
|
|
1165
1183
|
messageId: z3.string().min(1).optional(),
|
|
1166
1184
|
submittedAt: z3.string().datetime().optional(),
|
|
@@ -1190,18 +1208,8 @@ var sendChatMessageRequestSchema = z3.object({
|
|
|
1190
1208
|
senderEmail: z3.string().optional(),
|
|
1191
1209
|
senderDisplayName: z3.string().optional(),
|
|
1192
1210
|
senderAvatarUrl: z3.string().optional(),
|
|
1193
|
-
errorNotificationTarget:
|
|
1194
|
-
|
|
1195
|
-
z3.object({ type: z3.literal("linear"), sessionId: z3.string().min(1) }),
|
|
1196
|
-
z3.object({
|
|
1197
|
-
type: z3.literal("code_host"),
|
|
1198
|
-
provider: z3.enum(["github", "gitlab"]),
|
|
1199
|
-
resource: z3.enum(["issue", "pull_request"]),
|
|
1200
|
-
repositoryId: z3.string().min(1),
|
|
1201
|
-
resourceNumber: z3.number().int().positive()
|
|
1202
|
-
}),
|
|
1203
|
-
z3.object({ type: z3.literal("automation"), executionId: z3.string().min(1) })
|
|
1204
|
-
]).optional()
|
|
1211
|
+
errorNotificationTarget: integrationErrorNotificationTargetSchema.optional(),
|
|
1212
|
+
errorNotificationTargets: z3.array(integrationErrorNotificationTargetSchema).optional()
|
|
1205
1213
|
}).passthrough();
|
|
1206
1214
|
function isChatMessageSender(value) {
|
|
1207
1215
|
return isRecord(value) && (value.messageId === void 0 || typeof value.messageId === "string") && typeof value.senderUserId === "string" && typeof value.senderEmail === "string" && typeof value.recordedAt === "string";
|
|
@@ -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-M3A4WF5K.js";
|
|
7
7
|
import {
|
|
8
8
|
extractCommandProtectionCommandText,
|
|
9
9
|
findGitCommitSignals,
|
|
10
10
|
findPrMergeSignals
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2HBZMD3O.js";
|
|
12
12
|
|
|
13
13
|
// src/services/command-protection-service.ts
|
|
14
14
|
var DEFAULT_COMMAND_PROTECTION_BLOCK_MESSAGE = "Blocked by Replicas command protection.";
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
ENGINE_ENV,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
setAgentCredentialSnapshot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-M3A4WF5K.js";
|
|
9
9
|
import {
|
|
10
10
|
AppServerProcess,
|
|
11
11
|
SUBPROCESS_MAX_BUFFER,
|
|
12
12
|
buildCodexAgentEnv,
|
|
13
13
|
execFileAsync
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-USCNKCYW.js";
|
|
15
15
|
import {
|
|
16
16
|
isRecord
|
|
17
17
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
listOpenAICompatibleModels,
|
|
26
26
|
readOllamaAuthEnv,
|
|
27
27
|
resolveOpenAICompatibleModelsUrl
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-2HBZMD3O.js";
|
|
29
29
|
|
|
30
30
|
// src/managers/codex-token-manager.ts
|
|
31
31
|
import { promises as fs } from "fs";
|
|
@@ -251,7 +251,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
251
251
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
252
252
|
await this.applyCredentialsResponse(data);
|
|
253
253
|
if (data.scope) setAgentCredentialSnapshot("codex", { method: data.type, scope: data.scope, revision: data.revision });
|
|
254
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
254
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-UHA7DQNH.js");
|
|
255
255
|
await restartCodexAspHostIfRunning2();
|
|
256
256
|
});
|
|
257
257
|
await this.start(true);
|
|
@@ -271,7 +271,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
271
271
|
await this.applyCredentialUpdate(generation, async () => {
|
|
272
272
|
await this.applyCredentialsResponse(data);
|
|
273
273
|
if (restartOnChange && CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index])) {
|
|
274
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
274
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-UHA7DQNH.js");
|
|
275
275
|
await restartCodexAspHostIfRunning2();
|
|
276
276
|
}
|
|
277
277
|
if (data.scope) {
|
|
@@ -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-2HBZMD3O.js";
|
|
7
7
|
|
|
8
8
|
// src/services/post-tool-pr-notifier.ts
|
|
9
9
|
async function notifyPostToolUse(toolName, toolInput) {
|
|
@@ -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-2HBZMD3O.js";
|
|
8
8
|
|
|
9
9
|
// src/utils/codex-agent-env.ts
|
|
10
10
|
function buildCodexAgentEnv(source = process.env) {
|
|
@@ -245,7 +245,7 @@ function getCodexModelProvider(method) {
|
|
|
245
245
|
if (method === "foundry") return "azure";
|
|
246
246
|
return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
|
|
247
247
|
}
|
|
248
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
248
|
+
var ENGINE_PACKAGE_VERSION = "0.1.883";
|
|
249
249
|
var INITIALIZE_METHOD = "initialize";
|
|
250
250
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
251
251
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -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-BDG6FRDO.js";
|
|
7
|
+
import "./chunk-M3A4WF5K.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord
|
|
10
10
|
} from "./chunk-UZSNFLDQ.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-2HBZMD3O.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-BDG6FRDO.js";
|
|
7
7
|
import {
|
|
8
8
|
notifyPostToolUse
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-Q3M3WO7E.js";
|
|
10
|
+
import "./chunk-M3A4WF5K.js";
|
|
11
11
|
import "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-2HBZMD3O.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-USCNKCYW.js";
|
|
12
12
|
import {
|
|
13
13
|
AGENT,
|
|
14
14
|
getMemoryOutputSafetyViolation,
|
|
15
15
|
headlessAgentRequestSchema
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-2HBZMD3O.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-BDG6FRDO.js";
|
|
95
95
|
import {
|
|
96
96
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
97
97
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -133,21 +133,21 @@ import {
|
|
|
133
133
|
recordExhaustedCredential,
|
|
134
134
|
restartCodexAspHost,
|
|
135
135
|
routineRefreshExclusions
|
|
136
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-EW3NFV6B.js";
|
|
137
137
|
import {
|
|
138
138
|
ENGINE_ENV,
|
|
139
139
|
IS_WARMING_MODE,
|
|
140
140
|
monolithRequest,
|
|
141
141
|
monolithService,
|
|
142
142
|
setAgentCredentialSnapshot
|
|
143
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-M3A4WF5K.js";
|
|
144
144
|
import {
|
|
145
145
|
AspClient,
|
|
146
146
|
SUBPROCESS_MAX_BUFFER,
|
|
147
147
|
execAsync,
|
|
148
148
|
execFileAsync,
|
|
149
149
|
getCodexModelProvider
|
|
150
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-USCNKCYW.js";
|
|
151
151
|
import {
|
|
152
152
|
isRecord as isRecord2
|
|
153
153
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -362,7 +362,7 @@ import {
|
|
|
362
362
|
waitRelaySubagentRequestSchema,
|
|
363
363
|
withTimeout,
|
|
364
364
|
workspaceCredentialProviderSchema
|
|
365
|
-
} from "./chunk-
|
|
365
|
+
} from "./chunk-2HBZMD3O.js";
|
|
366
366
|
import {
|
|
367
367
|
__commonJS,
|
|
368
368
|
__export,
|
|
@@ -61649,8 +61649,16 @@ var ChatService = class {
|
|
|
61649
61649
|
}
|
|
61650
61650
|
chat.lastSendRequest = request;
|
|
61651
61651
|
this.agentChatActivityTrackerService.noteMessageAccepted(result.messageId, request);
|
|
61652
|
-
|
|
61653
|
-
|
|
61652
|
+
const notificationTargets = [
|
|
61653
|
+
...request.errorNotificationTargets ?? [],
|
|
61654
|
+
...request.errorNotificationTarget ? [request.errorNotificationTarget] : []
|
|
61655
|
+
];
|
|
61656
|
+
if (notificationTargets.length > 0) {
|
|
61657
|
+
const existingTargets = chat.errorNotificationTargets.get(result.messageId) ?? [];
|
|
61658
|
+
chat.errorNotificationTargets.set(result.messageId, [
|
|
61659
|
+
...existingTargets,
|
|
61660
|
+
...notificationTargets.filter((target) => !existingTargets.some((existing) => JSON.stringify(existing) === JSON.stringify(target)))
|
|
61661
|
+
]);
|
|
61654
61662
|
}
|
|
61655
61663
|
if (recordedSender) {
|
|
61656
61664
|
await this.appendSender(chatId, recordedSender);
|
|
@@ -61988,7 +61996,7 @@ var ChatService = class {
|
|
|
61988
61996
|
});
|
|
61989
61997
|
return formatChatForkHandoffMessage({ ...handoff, ...options });
|
|
61990
61998
|
}
|
|
61991
|
-
async runFork(targetId, request,
|
|
61999
|
+
async runFork(targetId, request, errorNotificationTargets) {
|
|
61992
62000
|
const target = this.chats.get(targetId);
|
|
61993
62001
|
const fork = target?.persisted.fork;
|
|
61994
62002
|
if (!target || !fork) return false;
|
|
@@ -62010,7 +62018,7 @@ var ChatService = class {
|
|
|
62010
62018
|
senderEmail: request.senderEmail,
|
|
62011
62019
|
senderDisplayName: request.senderDisplayName,
|
|
62012
62020
|
senderAvatarUrl: request.senderAvatarUrl,
|
|
62013
|
-
|
|
62021
|
+
errorNotificationTargets,
|
|
62014
62022
|
idempotencyKey: `chat-fork:${targetId}`
|
|
62015
62023
|
});
|
|
62016
62024
|
} catch (error) {
|
|
@@ -62062,10 +62070,10 @@ var ChatService = class {
|
|
|
62062
62070
|
senderAvatarUrl: last?.senderAvatarUrl
|
|
62063
62071
|
};
|
|
62064
62072
|
const fallback = await this.createForkTarget(chat.persisted.id, request, "auto", exhaustion.reason);
|
|
62065
|
-
const accepted = await this.runFork(fallback.id, request, chat.
|
|
62073
|
+
const accepted = await this.runFork(fallback.id, request, chat.activeErrorNotificationTargets);
|
|
62066
62074
|
if (!accepted) return false;
|
|
62067
62075
|
chat.lastTurnErrors = null;
|
|
62068
|
-
chat.
|
|
62076
|
+
chat.activeErrorNotificationTargets = [];
|
|
62069
62077
|
return true;
|
|
62070
62078
|
}
|
|
62071
62079
|
async getChatHistory(chatId, page2 = {}) {
|
|
@@ -62274,7 +62282,7 @@ var ChatService = class {
|
|
|
62274
62282
|
observedBranchesByRepo: /* @__PURE__ */ new Map(),
|
|
62275
62283
|
lastTurnErrors: null,
|
|
62276
62284
|
errorNotificationTargets: /* @__PURE__ */ new Map(),
|
|
62277
|
-
|
|
62285
|
+
activeErrorNotificationTargets: [],
|
|
62278
62286
|
quotaExhaustion: null,
|
|
62279
62287
|
lastSendRequest: null
|
|
62280
62288
|
};
|
|
@@ -62323,7 +62331,7 @@ var ChatService = class {
|
|
|
62323
62331
|
getChatExecutionProvider(chat.persisted)
|
|
62324
62332
|
);
|
|
62325
62333
|
this.agentTokenUsageTracker.startTurn(context);
|
|
62326
|
-
chat.
|
|
62334
|
+
chat.activeErrorNotificationTargets = chat.errorNotificationTargets.get(messageId) ?? [];
|
|
62327
62335
|
chat.errorNotificationTargets.delete(messageId);
|
|
62328
62336
|
}
|
|
62329
62337
|
async handleTurnStarted(chatId, message) {
|
|
@@ -62591,8 +62599,8 @@ var ChatService = class {
|
|
|
62591
62599
|
const linearSessionId = ENGINE_ENV.REPLICAS_LINEAR_SESSION_ID;
|
|
62592
62600
|
const errors = chat.persisted.parentChatId === null ? chat.lastTurnErrors : null;
|
|
62593
62601
|
chat.lastTurnErrors = null;
|
|
62594
|
-
const
|
|
62595
|
-
chat.
|
|
62602
|
+
const errorNotificationTargets = chat.activeErrorNotificationTargets;
|
|
62603
|
+
chat.activeErrorNotificationTargets = [];
|
|
62596
62604
|
const repoStatuses = await this.refreshTurnRepos(chat);
|
|
62597
62605
|
if (chat.persisted.parentChatId) return;
|
|
62598
62606
|
try {
|
|
@@ -62602,7 +62610,7 @@ var ChatService = class {
|
|
|
62602
62610
|
processing,
|
|
62603
62611
|
repoStatuses,
|
|
62604
62612
|
...errors?.length ? { errors } : {},
|
|
62605
|
-
...errors?.length &&
|
|
62613
|
+
...errors?.length && errorNotificationTargets.length > 0 ? { errorNotificationTargets } : {}
|
|
62606
62614
|
};
|
|
62607
62615
|
await monolithService.sendEvent({ type: "agent_turn_complete", payload });
|
|
62608
62616
|
} catch (error) {
|
|
@@ -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-Q3M3WO7E.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
9
|
} from "./chunk-UZSNFLDQ.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-2HBZMD3O.js";
|
|
11
11
|
import "./chunk-VEQXQN22.js";
|
|
12
12
|
|
|
13
13
|
// src/post-tool-pr-hook.ts
|
package/dist/src/relay-mcp.js
CHANGED