replicas-engine 0.1.1039 → 0.1.1041
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-52YDZURF.js → asp-host-UGBZ5E4S.js} +5 -5
- package/dist/src/{chunk-NB5C3CQZ.js → chunk-BE5TRPOL.js} +3 -3
- package/dist/src/{chunk-GSLZMNCV.js → chunk-CMXKQPDV.js} +1 -1
- package/dist/src/{chunk-N6AGUZF7.js → chunk-KXBTOL3R.js} +28 -4
- package/dist/src/{chunk-UZQH4AGN.js → chunk-SMBKCCEE.js} +2 -2
- package/dist/src/{chunk-WVNMT5CX.js → chunk-TR7NUUT3.js} +2 -2
- package/dist/src/{chunk-FAMMUWPY.js → chunk-UHAZHA6L.js} +6 -6
- package/dist/src/{chunk-X7IXJ47H.js → chunk-XS3QUSHQ.js} +1 -1
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +3 -3
- package/dist/src/index.js +11 -10
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
listRunningCodexModels,
|
|
9
9
|
restartCodexAspHost,
|
|
10
10
|
restartCodexAspHostIfRunning
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-UHAZHA6L.js";
|
|
12
|
+
import "./chunk-TR7NUUT3.js";
|
|
13
|
+
import "./chunk-BE5TRPOL.js";
|
|
14
|
+
import "./chunk-XS3QUSHQ.js";
|
|
15
15
|
import "./chunk-UZSNFLDQ.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-KXBTOL3R.js";
|
|
17
17
|
import "./chunk-VEQXQN22.js";
|
|
18
18
|
export {
|
|
19
19
|
CODEX_ULTRAFAST_SERVICE_TIER,
|
|
@@ -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-XS3QUSHQ.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KXBTOL3R.js";
|
|
10
10
|
|
|
11
11
|
// src/utils/codex-agent-env.ts
|
|
12
12
|
function buildCodexAgentEnv(source = process.env) {
|
|
@@ -240,7 +240,7 @@ function getCodexModelProvider(method) {
|
|
|
240
240
|
if (method === "foundry") return "azure";
|
|
241
241
|
return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
|
|
242
242
|
}
|
|
243
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
243
|
+
var ENGINE_PACKAGE_VERSION = "0.1.1041";
|
|
244
244
|
var INITIALIZE_METHOD = "initialize";
|
|
245
245
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
246
246
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -1130,6 +1130,7 @@ function getEventStreamId(event) {
|
|
|
1130
1130
|
}
|
|
1131
1131
|
var CODEX_QUOTA_STATUS_EVENT_TYPE = "codex-quota-status";
|
|
1132
1132
|
var CHAT_INTERRUPTED_EVENT_TYPE = "replicas-interrupted";
|
|
1133
|
+
var CHAT_MESSAGE_REJECTED_EVENT_TYPE = "replicas-message-rejected";
|
|
1133
1134
|
var CHAT_GOAL_EVENT_TYPE = "chat-goal";
|
|
1134
1135
|
var AUTH_RETRY_STATUS_EVENT_TYPE = "auth-retry-status";
|
|
1135
1136
|
var CURSOR_CONNECTION_STATUS_EVENT_TYPE = "cursor-connection-status";
|
|
@@ -1859,6 +1860,9 @@ async function readSseStream(body, onEvent, shouldContinue = () => true) {
|
|
|
1859
1860
|
}
|
|
1860
1861
|
}
|
|
1861
1862
|
|
|
1863
|
+
// ../shared/src/types.ts
|
|
1864
|
+
var ENGINE_SEND_MESSAGE_FAILED_ERROR = "Failed to send message";
|
|
1865
|
+
|
|
1862
1866
|
// ../shared/src/json.ts
|
|
1863
1867
|
function safeJsonParse(str, fallback) {
|
|
1864
1868
|
try {
|
|
@@ -5221,6 +5225,7 @@ var REPLICAS_MCP_TOOLS = {
|
|
|
5221
5225
|
createAutomation: "create_automation",
|
|
5222
5226
|
spawn: "spawn_workspace",
|
|
5223
5227
|
relay: "relay_to_workspace",
|
|
5228
|
+
listWorkspaces: "list_workspaces",
|
|
5224
5229
|
linearStart: "start_linear_session",
|
|
5225
5230
|
linearSessionIntent: "register_linear_session_intent",
|
|
5226
5231
|
listChannelSettings: "list_channel_settings",
|
|
@@ -7414,7 +7419,7 @@ function parseDisplayMessages(events, agentType, options = {}) {
|
|
|
7414
7419
|
else reconciledEvents.push(message2);
|
|
7415
7420
|
}
|
|
7416
7421
|
if (options.filter === false) return reconciledEvents;
|
|
7417
|
-
return
|
|
7422
|
+
return applyEngineNotices(
|
|
7418
7423
|
applyInterruptions(filterDisplayMessages(reconciledEvents, agentType), events),
|
|
7419
7424
|
events
|
|
7420
7425
|
);
|
|
@@ -7455,9 +7460,18 @@ function applyInterruptions(messages, events) {
|
|
|
7455
7460
|
}
|
|
7456
7461
|
return finalized;
|
|
7457
7462
|
}
|
|
7458
|
-
function
|
|
7463
|
+
function applyEngineNotices(messages, events) {
|
|
7459
7464
|
const notices = [];
|
|
7460
7465
|
events.forEach((event, index) => {
|
|
7466
|
+
if (event.type === CHAT_MESSAGE_REJECTED_EVENT_TYPE) {
|
|
7467
|
+
notices.push({
|
|
7468
|
+
id: `message-rejected-${event.timestamp}-${index}`,
|
|
7469
|
+
type: "error",
|
|
7470
|
+
message: typeof event.payload.message === "string" ? event.payload.message : "Message was rejected",
|
|
7471
|
+
timestamp: event.timestamp
|
|
7472
|
+
});
|
|
7473
|
+
return;
|
|
7474
|
+
}
|
|
7461
7475
|
if (event.type !== AUTH_FALLBACK_EVENT_TYPE) return;
|
|
7462
7476
|
const payload = coerceAuthFallbackPayload(event.payload);
|
|
7463
7477
|
if (!payload) return;
|
|
@@ -8989,8 +9003,17 @@ var mothershipSlackRelayRequestSchema = z18.object({
|
|
|
8989
9003
|
channel_id: slackChannelIdSchema,
|
|
8990
9004
|
thread_ts: slackThreadTsSchema,
|
|
8991
9005
|
message: z18.string().describe("The follow-up to deliver, combining every fresh message that belongs to this update."),
|
|
8992
|
-
user_id: z18.string().optional().describe("Slack user id of the follow-up's author (the envelope's `user_id`), so it is attributed to them. Defaults to the thread's original requester."),
|
|
8993
|
-
queue: z18.boolean().optional().describe("Set true only when the person explicitly asked for this to happen after the current task finishes. Delivers behind the active turn instead of interrupting it.")
|
|
9006
|
+
user_id: z18.string().optional().describe("Slack user id of the follow-up's author (the envelope's `user_id`), so it is attributed to them. Defaults to the thread's original requester. Required with `workspace_id`."),
|
|
9007
|
+
queue: z18.boolean().optional().describe("Set true only when the person explicitly asked for this to happen after the current task finishes. Delivers behind the active turn instead of interrupting it."),
|
|
9008
|
+
workspace_id: z18.string().optional().describe(`Existing workspace id, from \`${REPLICAS_MCP_TOOLS.listWorkspaces}\` or a workspace link in the thread, to bind a thread without a workspace to before relaying. The author must be able to see it. Omit to relay into the thread's own workspace.`),
|
|
9009
|
+
message_ts: z18.string().optional().describe("Timestamp of the Slack message that led to this relay (the envelope's `message_ts`). Required with `workspace_id`; the server verifies this message and its author.")
|
|
9010
|
+
});
|
|
9011
|
+
var mothershipListWorkspacesRequestSchema = z18.object({
|
|
9012
|
+
channel_id: slackChannelIdSchema,
|
|
9013
|
+
thread_ts: slackThreadTsSchema,
|
|
9014
|
+
message_ts: z18.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
|
|
9015
|
+
user_id: z18.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
|
|
9016
|
+
query: z18.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace names and pull request URLs.")
|
|
8994
9017
|
});
|
|
8995
9018
|
var mothershipSlackConfirmationSchema = z18.object({
|
|
8996
9019
|
confirmation_channel_id: z18.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
|
|
@@ -9698,6 +9721,7 @@ function isSkillRegistryManifest(value) {
|
|
|
9698
9721
|
}
|
|
9699
9722
|
|
|
9700
9723
|
export {
|
|
9724
|
+
ENGINE_SEND_MESSAGE_FAILED_ERROR,
|
|
9701
9725
|
isRecord,
|
|
9702
9726
|
isNonEmptyString,
|
|
9703
9727
|
safeJsonParse,
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
getOriginDefaultBranch,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
runGitCommand
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TR7NUUT3.js";
|
|
9
9
|
import {
|
|
10
10
|
extractCommandProtectionCommandText,
|
|
11
11
|
findCommandProtectionGitLookups,
|
|
12
12
|
findGitCommitSignals,
|
|
13
13
|
findPrMergeSignals,
|
|
14
14
|
parseCommandProtectionRequest
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-KXBTOL3R.js";
|
|
16
16
|
|
|
17
17
|
// src/services/command-protection-service.ts
|
|
18
18
|
import { readFile, stat } from "fs/promises";
|
|
@@ -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-XS3QUSHQ.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord as isRecord2
|
|
10
10
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
isValidAgentProvider,
|
|
19
19
|
parsePosixEnvFile,
|
|
20
20
|
readReplicasRuntimeEnv
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-KXBTOL3R.js";
|
|
22
22
|
|
|
23
23
|
// src/runtime-env-loader.ts
|
|
24
24
|
import { readFileSync } from "fs";
|
|
@@ -10,15 +10,15 @@ import {
|
|
|
10
10
|
resolveDiffBase,
|
|
11
11
|
runGitCommand,
|
|
12
12
|
setAgentCredentialSnapshot
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TR7NUUT3.js";
|
|
14
14
|
import {
|
|
15
15
|
AppServerProcess,
|
|
16
16
|
buildCodexAgentEnv
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-BE5TRPOL.js";
|
|
18
18
|
import {
|
|
19
19
|
SUBPROCESS_MAX_BUFFER,
|
|
20
20
|
execFileAsync
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-XS3QUSHQ.js";
|
|
22
22
|
import {
|
|
23
23
|
isRecord
|
|
24
24
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
readOllamaAuthEnv,
|
|
54
54
|
resolveOpenAICompatibleModelsUrl,
|
|
55
55
|
withTimeout
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-KXBTOL3R.js";
|
|
57
57
|
|
|
58
58
|
// src/managers/codex-token-manager.ts
|
|
59
59
|
import { promises as fs } from "fs";
|
|
@@ -289,7 +289,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
289
289
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
290
290
|
await this.applyCredentialsResponse(data);
|
|
291
291
|
setAgentCredentialSnapshot("codex", data);
|
|
292
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
292
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-UGBZ5E4S.js");
|
|
293
293
|
await restartCodexAspHostIfRunning2();
|
|
294
294
|
});
|
|
295
295
|
await this.start(true);
|
|
@@ -310,7 +310,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
310
310
|
const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
|
|
311
311
|
await this.applyCredentialsResponse(data);
|
|
312
312
|
if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
|
|
313
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
313
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-UGBZ5E4S.js");
|
|
314
314
|
await restartCodexAspHostIfRunning2();
|
|
315
315
|
}
|
|
316
316
|
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-KXBTOL3R.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -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-SMBKCCEE.js";
|
|
7
|
+
import "./chunk-TR7NUUT3.js";
|
|
8
|
+
import "./chunk-XS3QUSHQ.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-KXBTOL3R.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/command-protection-hook.ts
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
AppServerProcess,
|
|
9
9
|
buildCodexAgentEnv
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-BE5TRPOL.js";
|
|
11
|
+
import "./chunk-XS3QUSHQ.js";
|
|
12
12
|
import {
|
|
13
13
|
AGENT,
|
|
14
14
|
headlessAgentRequestSchema
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-KXBTOL3R.js";
|
|
16
16
|
import "./chunk-VEQXQN22.js";
|
|
17
17
|
|
|
18
18
|
// src/headless-agent.ts
|
package/dist/src/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
evaluateCommandProtection,
|
|
28
28
|
extractToolCommand,
|
|
29
29
|
reportCommandProtectionBlock
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-SMBKCCEE.js";
|
|
31
31
|
import {
|
|
32
32
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
33
33
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
} from "./chunk-P73LGPQO.js";
|
|
53
53
|
import {
|
|
54
54
|
publishedPullRequestUrls
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-CMXKQPDV.js";
|
|
56
56
|
import {
|
|
57
57
|
ACCOUNT_RATE_LIMITS_READ_METHOD,
|
|
58
58
|
AsyncLock,
|
|
@@ -114,7 +114,7 @@ import {
|
|
|
114
114
|
timestampFromSeconds,
|
|
115
115
|
upsertCredentialFileLines,
|
|
116
116
|
writeSecureCredentialFile
|
|
117
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-UHAZHA6L.js";
|
|
118
118
|
import {
|
|
119
119
|
ENGINE_ENV,
|
|
120
120
|
monolithRequest,
|
|
@@ -123,16 +123,16 @@ import {
|
|
|
123
123
|
reloadEngineEnv,
|
|
124
124
|
resolveDiffBase,
|
|
125
125
|
setAgentCredentialSnapshot
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-TR7NUUT3.js";
|
|
127
127
|
import {
|
|
128
128
|
AspClient,
|
|
129
129
|
getCodexModelProvider
|
|
130
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-BE5TRPOL.js";
|
|
131
131
|
import {
|
|
132
132
|
SUBPROCESS_MAX_BUFFER,
|
|
133
133
|
execAsync,
|
|
134
134
|
execFileAsync
|
|
135
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-XS3QUSHQ.js";
|
|
136
136
|
import {
|
|
137
137
|
isRecord as isRecord2
|
|
138
138
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -181,6 +181,7 @@ import {
|
|
|
181
181
|
ENGINE_HEALTH_MAX_WAIT_MS,
|
|
182
182
|
ENGINE_HEALTH_WAIT_HEADER,
|
|
183
183
|
ENGINE_HEALTH_WAIT_QUERY_PARAM,
|
|
184
|
+
ENGINE_SEND_MESSAGE_FAILED_ERROR,
|
|
184
185
|
ENGINE_SLEEP_PATH,
|
|
185
186
|
GITHUB_CREDENTIAL_REFRESH_PATH,
|
|
186
187
|
GITLAB_CREDENTIAL_REFRESH_PATH,
|
|
@@ -356,7 +357,7 @@ import {
|
|
|
356
357
|
workspaceTokenRequestSchema,
|
|
357
358
|
workspaceTokenResponseSchema,
|
|
358
359
|
wrapInTag
|
|
359
|
-
} from "./chunk-
|
|
360
|
+
} from "./chunk-KXBTOL3R.js";
|
|
360
361
|
import {
|
|
361
362
|
cloneMcpConfig,
|
|
362
363
|
ensureCompatibilityImports,
|
|
@@ -62298,15 +62299,15 @@ function createV1Routes(deps) {
|
|
|
62298
62299
|
} catch (error) {
|
|
62299
62300
|
const details = error instanceof Error ? error.message : "Unknown error";
|
|
62300
62301
|
if (error instanceof ChatNotFoundError) {
|
|
62301
|
-
return c.json(jsonError(
|
|
62302
|
+
return c.json(jsonError(ENGINE_SEND_MESSAGE_FAILED_ERROR, details), 404);
|
|
62302
62303
|
}
|
|
62303
62304
|
if (details.includes("Chat not found")) {
|
|
62304
|
-
return c.json(jsonError(
|
|
62305
|
+
return c.json(jsonError(ENGINE_SEND_MESSAGE_FAILED_ERROR, details), 404);
|
|
62305
62306
|
}
|
|
62306
62307
|
if (error instanceof ChatMessagePersistenceError) {
|
|
62307
62308
|
return c.json(jsonError("Failed to save user message", details), 500);
|
|
62308
62309
|
}
|
|
62309
|
-
return c.json(jsonError(
|
|
62310
|
+
return c.json(jsonError(ENGINE_SEND_MESSAGE_FAILED_ERROR, details), 400);
|
|
62310
62311
|
}
|
|
62311
62312
|
});
|
|
62312
62313
|
app2.post("/chats/:chatId/interrupt", async (c) => {
|
|
@@ -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-CMXKQPDV.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-KXBTOL3R.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