replicas-engine 0.1.482 → 0.1.484
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 +95 -76
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -583,7 +583,7 @@ var WORKSPACE_SIZES = ["small", "large"];
|
|
|
583
583
|
var INVALID_WORKSPACE_SIZE_ERROR = `Invalid size: must be one of ${WORKSPACE_SIZES.join(", ")}`;
|
|
584
584
|
|
|
585
585
|
// ../shared/src/e2b.ts
|
|
586
|
-
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-07-23-
|
|
586
|
+
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-07-23-v4";
|
|
587
587
|
|
|
588
588
|
// ../shared/src/runtime-env.ts
|
|
589
589
|
function shellQuotePosix(value) {
|
|
@@ -3177,9 +3177,28 @@ var workspaceChangedEventSchema = z3.discriminatedUnion("type", [
|
|
|
3177
3177
|
workspaceId: z3.string(),
|
|
3178
3178
|
chatId: z3.string(),
|
|
3179
3179
|
ts: z3.string()
|
|
3180
|
-
})
|
|
3180
|
+
}),
|
|
3181
|
+
z3.object({ type: z3.literal("presence.changed"), ts: z3.string() })
|
|
3181
3182
|
]);
|
|
3182
3183
|
|
|
3184
|
+
// ../shared/src/routes/presence.ts
|
|
3185
|
+
import { z as z4 } from "zod";
|
|
3186
|
+
var presenceStatusSchema = z4.enum(["online", "typing"]);
|
|
3187
|
+
var presenceLocationSchema = z4.object({
|
|
3188
|
+
environmentId: z4.string().optional(),
|
|
3189
|
+
workspaceId: z4.string().optional()
|
|
3190
|
+
});
|
|
3191
|
+
var presenceEntrySchema = z4.object({
|
|
3192
|
+
userId: z4.string(),
|
|
3193
|
+
status: presenceStatusSchema,
|
|
3194
|
+
location: presenceLocationSchema,
|
|
3195
|
+
ts: z4.string()
|
|
3196
|
+
});
|
|
3197
|
+
var updatePresenceRequestSchema = z4.object({
|
|
3198
|
+
status: presenceStatusSchema,
|
|
3199
|
+
location: presenceLocationSchema.optional()
|
|
3200
|
+
});
|
|
3201
|
+
|
|
3183
3202
|
// ../shared/src/audit-log.ts
|
|
3184
3203
|
var AUDIT_LOG_ACTION = {
|
|
3185
3204
|
CREATE: "create",
|
|
@@ -9829,7 +9848,7 @@ var DEFAULT_CODEX_ARGS = ["app-server", "--listen", "stdio://"];
|
|
|
9829
9848
|
var MIN_CODEX_CLI_VERSION = "0.144.6";
|
|
9830
9849
|
var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
|
|
9831
9850
|
var codexCliVersionEnsured = null;
|
|
9832
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
9851
|
+
var ENGINE_PACKAGE_VERSION = "0.1.484";
|
|
9833
9852
|
var INITIALIZE_METHOD = "initialize";
|
|
9834
9853
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
9835
9854
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -12374,7 +12393,7 @@ import { delimiter, dirname as dirname6, join as join18 } from "path";
|
|
|
12374
12393
|
import { randomBytes as randomBytes2 } from "crypto";
|
|
12375
12394
|
import { fileURLToPath } from "url";
|
|
12376
12395
|
import { Agent } from "undici";
|
|
12377
|
-
import { z as
|
|
12396
|
+
import { z as z5 } from "zod";
|
|
12378
12397
|
import {
|
|
12379
12398
|
createOpencodeClient,
|
|
12380
12399
|
createOpencodeServer
|
|
@@ -12411,9 +12430,9 @@ var OPENCODE_VARIANT_CANDIDATES_BY_THINKING_LEVEL = {
|
|
|
12411
12430
|
ultra: ["max", "xhigh", "high"],
|
|
12412
12431
|
ultracode: ["max", "xhigh", "high"]
|
|
12413
12432
|
};
|
|
12414
|
-
var opencodeAuthSchema =
|
|
12415
|
-
type:
|
|
12416
|
-
key:
|
|
12433
|
+
var opencodeAuthSchema = z5.record(z5.string(), z5.object({
|
|
12434
|
+
type: z5.string().optional(),
|
|
12435
|
+
key: z5.string().optional()
|
|
12417
12436
|
}));
|
|
12418
12437
|
async function hasOpenCodeGoCredentials() {
|
|
12419
12438
|
if (!existsSync6(OPENCODE_AUTH_PATH2)) return false;
|
|
@@ -13264,7 +13283,7 @@ var PiManager = class extends CodingAgentManager {
|
|
|
13264
13283
|
|
|
13265
13284
|
// src/managers/relay-tools.ts
|
|
13266
13285
|
import { createSdkMcpServer, tool } from "@anthropic-ai/claude-agent-sdk";
|
|
13267
|
-
import { z as
|
|
13286
|
+
import { z as z6 } from "zod";
|
|
13268
13287
|
|
|
13269
13288
|
// src/managers/relay-providers.ts
|
|
13270
13289
|
function isRelaySubagentProviderAllowed(provider, allowedProviders) {
|
|
@@ -13379,7 +13398,7 @@ function buildSpawnAgentTool(parentChatId, availability = {}, getAllowedProvider
|
|
|
13379
13398
|
const cursorAvailable = availability.cursorAvailable ?? false;
|
|
13380
13399
|
const opencodeAvailable = availability.opencodeAvailable ?? false;
|
|
13381
13400
|
const availableProviders = getAvailableRelayProviders(availability);
|
|
13382
|
-
const providerEnum =
|
|
13401
|
+
const providerEnum = z6.enum(availableProviders);
|
|
13383
13402
|
const codeProviders = getAvailableCodeProviders(availability);
|
|
13384
13403
|
const providerDesc = codeProviders.length > 0 ? `Which agent to use. Prefer ${codeProviders.join(" or ")} for code writing, claude for exploration/analysis, relay for complex multi-step orchestration.` : "Which agent to use. Use claude for code writing, exploration, and analysis. Use relay for complex multi-step orchestration.";
|
|
13385
13404
|
const useCases = codeProviders.length > 0 ? `- Complex code writing tasks (use provider '${codeProviders.join("' or '")}' with a capable model)
|
|
@@ -13398,18 +13417,18 @@ The tool blocks until the subagent completes and returns its final response.
|
|
|
13398
13417
|
You will also receive the chatId so you can send follow-up messages or clean up the chat.`,
|
|
13399
13418
|
{
|
|
13400
13419
|
provider: providerEnum.describe(providerDesc),
|
|
13401
|
-
prompt:
|
|
13402
|
-
model:
|
|
13420
|
+
prompt: z6.string().describe("The full prompt/instructions for the subagent. Be detailed - it has no context from your conversation."),
|
|
13421
|
+
model: z6.string().optional().describe([
|
|
13403
13422
|
`Model override. Claude: ${AGENT_MODELS.claude.join(", ")} (opus is the default; sonnet is faster).`,
|
|
13404
13423
|
codexAvailable ? `Codex: ${AGENT_MODELS.codex.join(", ")}.` : null,
|
|
13405
13424
|
cursorAvailable ? `Cursor: ${AGENT_MODELS.cursor.join(", ")}.` : null,
|
|
13406
13425
|
opencodeAvailable ? `Opencode: ${AGENT_MODELS.opencode.join(", ")}.` : null
|
|
13407
13426
|
].filter(Boolean).join(" ")),
|
|
13408
|
-
thinking_level:
|
|
13427
|
+
thinking_level: z6.enum(VALID_THINKING_LEVELS).optional().describe(
|
|
13409
13428
|
"Controls how much thinking/reasoning the subagent applies. low = light thinking, medium = moderate, high = deep reasoning, xhigh = extended effort, max = maximum effort, ultra = Codex ultra, ultracode = Claude Code dynamic workflows. Defaults: Claude = high, Codex = medium, Cursor = medium, Opencode = medium."
|
|
13410
13429
|
),
|
|
13411
|
-
title:
|
|
13412
|
-
timeout_minutes:
|
|
13430
|
+
title: z6.string().optional().describe("Optional title for the subagent chat (for identification)."),
|
|
13431
|
+
timeout_minutes: z6.number().positive().optional().describe("Timeout in minutes for the subagent to complete (default: 10). Set higher for large tasks to avoid losing work.")
|
|
13413
13432
|
},
|
|
13414
13433
|
async (args) => {
|
|
13415
13434
|
try {
|
|
@@ -13484,13 +13503,13 @@ var messageAgentTool = tool(
|
|
|
13484
13503
|
|
|
13485
13504
|
The tool blocks until the subagent completes and returns its response.`,
|
|
13486
13505
|
{
|
|
13487
|
-
chatId:
|
|
13488
|
-
message:
|
|
13489
|
-
model:
|
|
13490
|
-
thinking_level:
|
|
13506
|
+
chatId: z6.string().describe("The chat ID of the subagent (returned by spawn_agent)."),
|
|
13507
|
+
message: z6.string().describe("The follow-up message to send."),
|
|
13508
|
+
model: z6.string().optional().describe("Optional model override for this message."),
|
|
13509
|
+
thinking_level: z6.enum(VALID_THINKING_LEVELS).optional().describe(
|
|
13491
13510
|
"Controls how much thinking/reasoning the subagent applies. low = light thinking, medium = moderate, high = deep reasoning, xhigh = extended effort, max = maximum effort, ultra = Codex ultra, ultracode = Claude Code dynamic workflows. Defaults: Claude = high, Codex = medium, Cursor = medium, Opencode = medium."
|
|
13492
13511
|
),
|
|
13493
|
-
timeout_minutes:
|
|
13512
|
+
timeout_minutes: z6.number().positive().optional().describe("Timeout in minutes for the subagent to complete (default: 10). Set higher for large tasks to avoid losing work.")
|
|
13494
13513
|
},
|
|
13495
13514
|
async (args) => {
|
|
13496
13515
|
try {
|
|
@@ -13528,7 +13547,7 @@ var deleteAgentTool = tool(
|
|
|
13528
13547
|
"delete_agent",
|
|
13529
13548
|
`Delete a subagent chat to free resources. Use this after a subagent has completed its work and you no longer need to send it follow-up messages.`,
|
|
13530
13549
|
{
|
|
13531
|
-
chatId:
|
|
13550
|
+
chatId: z6.string().describe("The chat ID of the subagent to delete.")
|
|
13532
13551
|
},
|
|
13533
13552
|
async (args) => {
|
|
13534
13553
|
try {
|
|
@@ -15366,7 +15385,7 @@ var RepoFileService = class {
|
|
|
15366
15385
|
|
|
15367
15386
|
// src/v1-routes.ts
|
|
15368
15387
|
import { Hono } from "hono";
|
|
15369
|
-
import { z as
|
|
15388
|
+
import { z as z7 } from "zod";
|
|
15370
15389
|
import { readdir as readdir9, stat as stat5, readFile as readFile18 } from "fs/promises";
|
|
15371
15390
|
import { join as join26, resolve as resolve3 } from "path";
|
|
15372
15391
|
|
|
@@ -15874,72 +15893,72 @@ var TerminalService = class {
|
|
|
15874
15893
|
var terminalService = new TerminalService();
|
|
15875
15894
|
|
|
15876
15895
|
// src/v1-routes.ts
|
|
15877
|
-
var imageMediaTypeSchema =
|
|
15878
|
-
var createPreviewSchema =
|
|
15879
|
-
port:
|
|
15880
|
-
publicUrl:
|
|
15896
|
+
var imageMediaTypeSchema = z7.enum(IMAGE_MEDIA_TYPES);
|
|
15897
|
+
var createPreviewSchema = z7.object({
|
|
15898
|
+
port: z7.number().int().min(1).max(65535),
|
|
15899
|
+
publicUrl: z7.string().min(1)
|
|
15881
15900
|
});
|
|
15882
|
-
var terminalSizeSchema =
|
|
15883
|
-
cols:
|
|
15884
|
-
rows:
|
|
15901
|
+
var terminalSizeSchema = z7.object({
|
|
15902
|
+
cols: z7.number().int().min(2).max(500),
|
|
15903
|
+
rows: z7.number().int().min(1).max(200)
|
|
15885
15904
|
});
|
|
15886
|
-
var writeTerminalSessionSchema =
|
|
15887
|
-
data:
|
|
15888
|
-
generation:
|
|
15889
|
-
sequence:
|
|
15905
|
+
var writeTerminalSessionSchema = z7.object({
|
|
15906
|
+
data: z7.string().max(64 * 1024),
|
|
15907
|
+
generation: z7.number().int().nonnegative(),
|
|
15908
|
+
sequence: z7.number().int().nonnegative()
|
|
15890
15909
|
});
|
|
15891
|
-
var sendMessageSchema =
|
|
15892
|
-
messageId:
|
|
15893
|
-
submittedAt:
|
|
15894
|
-
message:
|
|
15895
|
-
model:
|
|
15896
|
-
customInstructions:
|
|
15897
|
-
planMode:
|
|
15898
|
-
images:
|
|
15899
|
-
type:
|
|
15900
|
-
source:
|
|
15901
|
-
|
|
15902
|
-
type:
|
|
15910
|
+
var sendMessageSchema = z7.object({
|
|
15911
|
+
messageId: z7.string().min(1).optional(),
|
|
15912
|
+
submittedAt: z7.string().datetime().optional(),
|
|
15913
|
+
message: z7.string().min(1),
|
|
15914
|
+
model: z7.string().optional(),
|
|
15915
|
+
customInstructions: z7.string().optional(),
|
|
15916
|
+
planMode: z7.boolean().optional(),
|
|
15917
|
+
images: z7.array(z7.object({
|
|
15918
|
+
type: z7.literal("image"),
|
|
15919
|
+
source: z7.union([
|
|
15920
|
+
z7.object({
|
|
15921
|
+
type: z7.literal("base64"),
|
|
15903
15922
|
media_type: imageMediaTypeSchema,
|
|
15904
|
-
data:
|
|
15923
|
+
data: z7.string().min(1)
|
|
15905
15924
|
}),
|
|
15906
|
-
|
|
15907
|
-
type:
|
|
15908
|
-
url:
|
|
15925
|
+
z7.object({
|
|
15926
|
+
type: z7.literal("url"),
|
|
15927
|
+
url: z7.string().url()
|
|
15909
15928
|
})
|
|
15910
15929
|
])
|
|
15911
15930
|
})).optional(),
|
|
15912
|
-
thinkingLevel:
|
|
15913
|
-
goalMode:
|
|
15914
|
-
fastMode:
|
|
15915
|
-
enableInteractiveTools:
|
|
15916
|
-
type:
|
|
15917
|
-
merge:
|
|
15918
|
-
idempotencyKey:
|
|
15919
|
-
senderUserId:
|
|
15920
|
-
senderEmail:
|
|
15921
|
-
senderDisplayName:
|
|
15922
|
-
senderAvatarUrl:
|
|
15923
|
-
errorNotificationTarget:
|
|
15924
|
-
|
|
15925
|
-
|
|
15926
|
-
|
|
15927
|
-
type:
|
|
15928
|
-
provider:
|
|
15929
|
-
resource:
|
|
15930
|
-
repositoryId:
|
|
15931
|
-
resourceNumber:
|
|
15931
|
+
thinkingLevel: z7.enum(VALID_THINKING_LEVELS).optional(),
|
|
15932
|
+
goalMode: z7.boolean().optional(),
|
|
15933
|
+
fastMode: z7.boolean().optional(),
|
|
15934
|
+
enableInteractiveTools: z7.boolean().optional(),
|
|
15935
|
+
type: z7.string().min(1).optional(),
|
|
15936
|
+
merge: z7.boolean().optional(),
|
|
15937
|
+
idempotencyKey: z7.string().min(1).max(128).optional(),
|
|
15938
|
+
senderUserId: z7.string().optional(),
|
|
15939
|
+
senderEmail: z7.string().optional(),
|
|
15940
|
+
senderDisplayName: z7.string().optional(),
|
|
15941
|
+
senderAvatarUrl: z7.string().optional(),
|
|
15942
|
+
errorNotificationTarget: z7.discriminatedUnion("type", [
|
|
15943
|
+
z7.object({ type: z7.literal("slack") }),
|
|
15944
|
+
z7.object({ type: z7.literal("linear"), sessionId: z7.string().min(1) }),
|
|
15945
|
+
z7.object({
|
|
15946
|
+
type: z7.literal("code_host"),
|
|
15947
|
+
provider: z7.enum(["github", "gitlab"]),
|
|
15948
|
+
resource: z7.enum(["issue", "pull_request"]),
|
|
15949
|
+
repositoryId: z7.string().min(1),
|
|
15950
|
+
resourceNumber: z7.number().int().positive()
|
|
15932
15951
|
}),
|
|
15933
|
-
|
|
15952
|
+
z7.object({ type: z7.literal("automation"), executionId: z7.string().min(1) })
|
|
15934
15953
|
]).optional()
|
|
15935
15954
|
});
|
|
15936
|
-
var respondToolInputSchema =
|
|
15937
|
-
requestId:
|
|
15938
|
-
selectionId:
|
|
15955
|
+
var respondToolInputSchema = z7.object({
|
|
15956
|
+
requestId: z7.string().min(1),
|
|
15957
|
+
selectionId: z7.string().min(1)
|
|
15939
15958
|
});
|
|
15940
|
-
var updateGoalSchema =
|
|
15941
|
-
objective:
|
|
15942
|
-
status:
|
|
15959
|
+
var updateGoalSchema = z7.object({
|
|
15960
|
+
objective: z7.string().trim().min(1).max(MAX_CODEX_GOAL_OBJECTIVE_CHARS).optional(),
|
|
15961
|
+
status: z7.enum(["active", "paused"]).optional()
|
|
15943
15962
|
}).refine((body) => body.objective !== void 0 || body.status !== void 0, {
|
|
15944
15963
|
message: "Goal objective or status required"
|
|
15945
15964
|
});
|
|
@@ -16130,7 +16149,7 @@ function createV1Routes(deps) {
|
|
|
16130
16149
|
const result = await deps.chatService.updateGoal(c.req.param("chatId"), body);
|
|
16131
16150
|
return c.json(result);
|
|
16132
16151
|
} catch (error) {
|
|
16133
|
-
if (error instanceof
|
|
16152
|
+
if (error instanceof z7.ZodError) {
|
|
16134
16153
|
return c.json(jsonError(error.issues[0]?.message || "Invalid goal update"), 400);
|
|
16135
16154
|
}
|
|
16136
16155
|
if (error instanceof ChatNotFoundError) {
|