replicas-engine 0.1.470 → 0.1.472

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.
Files changed (2) hide show
  1. package/dist/src/index.js +150 -86
  2. package/package.json +1 -1
package/dist/src/index.js CHANGED
@@ -582,7 +582,7 @@ var WORKSPACE_SIZES = ["small", "large"];
582
582
  var INVALID_WORKSPACE_SIZE_ERROR = `Invalid size: must be one of ${WORKSPACE_SIZES.join(", ")}`;
583
583
 
584
584
  // ../shared/src/e2b.ts
585
- var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-07-20-v2";
585
+ var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-07-21-v2";
586
586
 
587
587
  // ../shared/src/runtime-env.ts
588
588
  function shellQuotePosix(value) {
@@ -1190,7 +1190,7 @@ GitHub does NOT have a public API for uploading images to PRs/issues. When you n
1190
1190
  - Do NOT commit screenshots as files to the repository
1191
1191
  - Run \`replicas media upload <image> --share\` and put the printed \`Forge embed\` Markdown in the PR body or comment
1192
1192
  - For video, embed a shared poster image linked to the recording's **View in Replicas** URL; GitHub does not reliably render externally hosted video inline
1193
- - Treat the public URL as an opt-in bearer capability and revoke it with \`replicas media revoke <media-id>\` when appropriate
1193
+ - Treat the public URL as an opt-in bearer capability; revoke it with \`replicas media revoke <media-id>\` only when the user asks or the media should stop rendering \u2014 revoking breaks embeds already posted on the PR
1194
1194
  - If you were triggered from Slack, also upload the image to the Slack thread so the user can see it directly
1195
1195
  `;
1196
1196
  var GITHUB_ABILITY = {
@@ -1969,7 +1969,7 @@ GitHub does not reliably render arbitrary external videos as inline players. For
1969
1969
  [![Demo recording](<public-poster-url>)](<recording-dashboard-url>)
1970
1970
  \`\`\`
1971
1971
 
1972
- Public forge shares are bearer capabilities. For private repositories, create one only when the user asked for inline PR media, and revoke it with \`replicas media revoke <media-id>\` when it should stop resolving.
1972
+ Public forge shares are bearer capabilities. For private repositories, create one only when the user asked for inline PR media. Revoke with \`replicas media revoke <media-id>\` **only** when the user asks or the media should intentionally stop rendering \u2014 never as routine post-task cleanup, since revoking breaks every embed already posted on the PR.
1973
1973
 
1974
1974
  Do **not** commit screenshots to the repo, use placeholder URLs, expose the authenticated \`/v1/media/<id>\` URL, or automate GitHub's undocumented browser upload flow.
1975
1975
 
@@ -2809,6 +2809,44 @@ var createChatRequestSchema = z2.object({
2809
2809
  parentChatId: z2.string().uuid().optional(),
2810
2810
  clientRequestId: z2.string().min(1).max(128).optional()
2811
2811
  });
2812
+ var sendChatMessageRequestSchema = z2.object({
2813
+ messageId: z2.string().optional(),
2814
+ submittedAt: z2.string().optional(),
2815
+ message: z2.string(),
2816
+ model: z2.string().optional(),
2817
+ customInstructions: z2.string().optional(),
2818
+ planMode: z2.boolean().optional(),
2819
+ images: z2.array(z2.object({
2820
+ type: z2.literal("image"),
2821
+ source: z2.discriminatedUnion("type", [
2822
+ z2.object({ type: z2.literal("base64"), media_type: z2.enum(IMAGE_MEDIA_TYPES), data: z2.string() }),
2823
+ z2.object({ type: z2.literal("url"), url: z2.string() })
2824
+ ])
2825
+ })).optional(),
2826
+ thinkingLevel: z2.enum(VALID_THINKING_LEVELS).optional(),
2827
+ goalMode: z2.boolean().optional(),
2828
+ fastMode: z2.boolean().optional(),
2829
+ enableInteractiveTools: z2.boolean().optional(),
2830
+ type: z2.string().optional(),
2831
+ merge: z2.boolean().optional(),
2832
+ idempotencyKey: z2.string().optional(),
2833
+ senderUserId: z2.string().optional(),
2834
+ senderEmail: z2.string().optional(),
2835
+ senderDisplayName: z2.string().optional(),
2836
+ senderAvatarUrl: z2.string().optional(),
2837
+ errorNotificationTarget: z2.discriminatedUnion("type", [
2838
+ z2.object({ type: z2.literal("slack") }),
2839
+ z2.object({ type: z2.literal("linear"), sessionId: z2.string() }),
2840
+ z2.object({
2841
+ type: z2.literal("code_host"),
2842
+ provider: z2.enum(["github", "gitlab"]),
2843
+ resource: z2.enum(["issue", "pull_request"]),
2844
+ repositoryId: z2.string(),
2845
+ resourceNumber: z2.number()
2846
+ }),
2847
+ z2.object({ type: z2.literal("automation"), executionId: z2.string() })
2848
+ ]).optional()
2849
+ }).passthrough();
2812
2850
  function normalizeCodexAspTranscriptStatus(status, failed = false) {
2813
2851
  if (failed || status === "failed" || status === "declined") return "failed";
2814
2852
  if (status === "completed") return "completed";
@@ -3137,6 +3175,18 @@ var DEFAULT_WORKSPACE_FILTERS = {
3137
3175
  };
3138
3176
  var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
3139
3177
 
3178
+ // ../shared/src/routes/workspace-events.ts
3179
+ import { z as z3 } from "zod";
3180
+ var workspaceChangedEventSchema = z3.discriminatedUnion("type", [
3181
+ z3.object({ type: z3.literal("workspace.changed"), workspaceId: z3.string(), ts: z3.string() }),
3182
+ z3.object({
3183
+ type: z3.literal("workspace.chat.changed"),
3184
+ workspaceId: z3.string(),
3185
+ chatId: z3.string(),
3186
+ ts: z3.string()
3187
+ })
3188
+ ]);
3189
+
3140
3190
  // ../shared/src/audit-log.ts
3141
3191
  var AUDIT_LOG_ACTION = {
3142
3192
  CREATE: "create",
@@ -9832,7 +9882,7 @@ var DEFAULT_CODEX_ARGS = ["app-server", "--listen", "stdio://"];
9832
9882
  var MIN_CODEX_CLI_VERSION = "0.144.6";
9833
9883
  var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
9834
9884
  var codexCliVersionEnsured = null;
9835
- var ENGINE_PACKAGE_VERSION = "0.1.470";
9885
+ var ENGINE_PACKAGE_VERSION = "0.1.472";
9836
9886
  var INITIALIZE_METHOD = "initialize";
9837
9887
  var INITIALIZED_NOTIFICATION = "initialized";
9838
9888
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -12063,6 +12113,7 @@ var CursorManager = class extends CodingAgentManager {
12063
12113
  abortActiveTurn = null;
12064
12114
  blockedToolCallIds = /* @__PURE__ */ new Set();
12065
12115
  pendingCursorBlockReason = null;
12116
+ instructionsDelivered = false;
12066
12117
  historyFilePath;
12067
12118
  historyFile;
12068
12119
  slashCommandsCache = null;
@@ -12136,16 +12187,18 @@ var CursorManager = class extends CodingAgentManager {
12136
12187
  throw new Error("Cursor API key is not configured for this workspace.");
12137
12188
  }
12138
12189
  const model = { id: request.model ?? DEFAULT_CURSOR_MODEL };
12190
+ const settingSources = ["project", "user"];
12191
+ const local = { cwd: this.workingDirectory, settingSources };
12139
12192
  this.agent = this.initialSessionId ? await CursorAgent.resume(this.initialSessionId, {
12140
12193
  apiKey,
12141
12194
  model,
12142
- local: { cwd: this.workingDirectory }
12195
+ local
12143
12196
  }) : await CursorAgent.create({
12144
12197
  apiKey,
12145
12198
  model,
12146
- local: { cwd: this.workingDirectory }
12199
+ local
12147
12200
  });
12148
- await this.onSaveSessionId(this.agent.agentId);
12201
+ if (this.initialSessionId) await this.onSaveSessionId(this.agent.agentId);
12149
12202
  return this.agent;
12150
12203
  }
12151
12204
  async processMessageInternal(request) {
@@ -12156,8 +12209,9 @@ var CursorManager = class extends CodingAgentManager {
12156
12209
  const linearSessionId = ENGINE_ENV.LINEAR_SESSION_ID;
12157
12210
  const linearForwarder = new LinearEventForwarder(linearSessionId);
12158
12211
  try {
12212
+ const includeInstructions = !this.initialSessionId && !this.instructionsDelivered;
12213
+ const message = await this.toCursorMessage(request, includeInstructions);
12159
12214
  const agent = await this.ensureAgent(request);
12160
- const message = await this.toCursorMessage(request);
12161
12215
  const model = request.model ?? DEFAULT_CURSOR_MODEL;
12162
12216
  this.recordHistoryEvent("event_msg", {
12163
12217
  type: "user_message",
@@ -12211,6 +12265,10 @@ var CursorManager = class extends CodingAgentManager {
12211
12265
  if (result === TIMEOUT) {
12212
12266
  throw new Error("Cursor run did not report a result after its event stream ended");
12213
12267
  }
12268
+ if (includeInstructions) {
12269
+ this.instructionsDelivered = true;
12270
+ await this.onSaveSessionId(agent.agentId);
12271
+ }
12214
12272
  if (result.status === "error") {
12215
12273
  this.recordHistoryEvent("cursor-error", {
12216
12274
  type: "error",
@@ -12269,13 +12327,19 @@ var CursorManager = class extends CodingAgentManager {
12269
12327
  }
12270
12328
  this.pendingCursorBlockReason = message;
12271
12329
  }
12272
- async toCursorMessage(request) {
12330
+ async toCursorMessage(request, includeInstructions) {
12331
+ const instructions = includeInstructions ? this.buildCombinedInstructions(request.customInstructions) : void 0;
12332
+ const text = instructions ? `<workspace-instructions>
12333
+ ${instructions}
12334
+ </workspace-instructions>
12335
+
12336
+ ${request.message}` : request.message;
12273
12337
  if (!request.images || request.images.length === 0) {
12274
- return request.message;
12338
+ return text;
12275
12339
  }
12276
12340
  const images = await normalizeImages(request.images);
12277
12341
  return {
12278
- text: request.message,
12342
+ text,
12279
12343
  images: images.map((image) => ({
12280
12344
  data: image.source.data,
12281
12345
  mimeType: image.source.media_type
@@ -12357,7 +12421,7 @@ import { delimiter, dirname as dirname6, join as join18 } from "path";
12357
12421
  import { randomBytes as randomBytes2 } from "crypto";
12358
12422
  import { fileURLToPath } from "url";
12359
12423
  import { Agent } from "undici";
12360
- import { z as z3 } from "zod";
12424
+ import { z as z4 } from "zod";
12361
12425
  import {
12362
12426
  createOpencodeClient,
12363
12427
  createOpencodeServer
@@ -12394,9 +12458,9 @@ var OPENCODE_VARIANT_CANDIDATES_BY_THINKING_LEVEL = {
12394
12458
  ultra: ["max", "xhigh", "high"],
12395
12459
  ultracode: ["max", "xhigh", "high"]
12396
12460
  };
12397
- var opencodeAuthSchema = z3.record(z3.string(), z3.object({
12398
- type: z3.string().optional(),
12399
- key: z3.string().optional()
12461
+ var opencodeAuthSchema = z4.record(z4.string(), z4.object({
12462
+ type: z4.string().optional(),
12463
+ key: z4.string().optional()
12400
12464
  }));
12401
12465
  async function hasOpenCodeGoCredentials() {
12402
12466
  if (!existsSync7(OPENCODE_AUTH_PATH2)) return false;
@@ -13241,7 +13305,7 @@ var PiManager = class extends CodingAgentManager {
13241
13305
 
13242
13306
  // src/managers/relay-tools.ts
13243
13307
  import { createSdkMcpServer, tool } from "@anthropic-ai/claude-agent-sdk";
13244
- import { z as z4 } from "zod";
13308
+ import { z as z5 } from "zod";
13245
13309
 
13246
13310
  // src/managers/relay-providers.ts
13247
13311
  function isRelaySubagentProviderAllowed(provider, allowedProviders) {
@@ -13356,7 +13420,7 @@ function buildSpawnAgentTool(parentChatId, availability = {}, getAllowedProvider
13356
13420
  const cursorAvailable = availability.cursorAvailable ?? false;
13357
13421
  const opencodeAvailable = availability.opencodeAvailable ?? false;
13358
13422
  const availableProviders = getAvailableRelayProviders(availability);
13359
- const providerEnum = z4.enum(availableProviders);
13423
+ const providerEnum = z5.enum(availableProviders);
13360
13424
  const codeProviders = getAvailableCodeProviders(availability);
13361
13425
  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.";
13362
13426
  const useCases = codeProviders.length > 0 ? `- Complex code writing tasks (use provider '${codeProviders.join("' or '")}' with a capable model)
@@ -13375,18 +13439,18 @@ The tool blocks until the subagent completes and returns its final response.
13375
13439
  You will also receive the chatId so you can send follow-up messages or clean up the chat.`,
13376
13440
  {
13377
13441
  provider: providerEnum.describe(providerDesc),
13378
- prompt: z4.string().describe("The full prompt/instructions for the subagent. Be detailed - it has no context from your conversation."),
13379
- model: z4.string().optional().describe([
13442
+ prompt: z5.string().describe("The full prompt/instructions for the subagent. Be detailed - it has no context from your conversation."),
13443
+ model: z5.string().optional().describe([
13380
13444
  `Model override. Claude: ${AGENT_MODELS.claude.join(", ")} (opus is the default; sonnet is faster).`,
13381
13445
  codexAvailable ? `Codex: ${AGENT_MODELS.codex.join(", ")}.` : null,
13382
13446
  cursorAvailable ? `Cursor: ${AGENT_MODELS.cursor.join(", ")}.` : null,
13383
13447
  opencodeAvailable ? `Opencode: ${AGENT_MODELS.opencode.join(", ")}.` : null
13384
13448
  ].filter(Boolean).join(" ")),
13385
- thinking_level: z4.enum(VALID_THINKING_LEVELS).optional().describe(
13449
+ thinking_level: z5.enum(VALID_THINKING_LEVELS).optional().describe(
13386
13450
  "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."
13387
13451
  ),
13388
- title: z4.string().optional().describe("Optional title for the subagent chat (for identification)."),
13389
- timeout_minutes: z4.number().positive().optional().describe("Timeout in minutes for the subagent to complete (default: 10). Set higher for large tasks to avoid losing work.")
13452
+ title: z5.string().optional().describe("Optional title for the subagent chat (for identification)."),
13453
+ timeout_minutes: z5.number().positive().optional().describe("Timeout in minutes for the subagent to complete (default: 10). Set higher for large tasks to avoid losing work.")
13390
13454
  },
13391
13455
  async (args) => {
13392
13456
  try {
@@ -13461,13 +13525,13 @@ var messageAgentTool = tool(
13461
13525
 
13462
13526
  The tool blocks until the subagent completes and returns its response.`,
13463
13527
  {
13464
- chatId: z4.string().describe("The chat ID of the subagent (returned by spawn_agent)."),
13465
- message: z4.string().describe("The follow-up message to send."),
13466
- model: z4.string().optional().describe("Optional model override for this message."),
13467
- thinking_level: z4.enum(VALID_THINKING_LEVELS).optional().describe(
13528
+ chatId: z5.string().describe("The chat ID of the subagent (returned by spawn_agent)."),
13529
+ message: z5.string().describe("The follow-up message to send."),
13530
+ model: z5.string().optional().describe("Optional model override for this message."),
13531
+ thinking_level: z5.enum(VALID_THINKING_LEVELS).optional().describe(
13468
13532
  "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."
13469
13533
  ),
13470
- timeout_minutes: z4.number().positive().optional().describe("Timeout in minutes for the subagent to complete (default: 10). Set higher for large tasks to avoid losing work.")
13534
+ timeout_minutes: z5.number().positive().optional().describe("Timeout in minutes for the subagent to complete (default: 10). Set higher for large tasks to avoid losing work.")
13471
13535
  },
13472
13536
  async (args) => {
13473
13537
  try {
@@ -13505,7 +13569,7 @@ var deleteAgentTool = tool(
13505
13569
  "delete_agent",
13506
13570
  `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.`,
13507
13571
  {
13508
- chatId: z4.string().describe("The chat ID of the subagent to delete.")
13572
+ chatId: z5.string().describe("The chat ID of the subagent to delete.")
13509
13573
  },
13510
13574
  async (args) => {
13511
13575
  try {
@@ -15331,7 +15395,7 @@ var RepoFileService = class {
15331
15395
 
15332
15396
  // src/v1-routes.ts
15333
15397
  import { Hono } from "hono";
15334
- import { z as z5 } from "zod";
15398
+ import { z as z6 } from "zod";
15335
15399
  import { readdir as readdir9, stat as stat5, readFile as readFile18 } from "fs/promises";
15336
15400
  import { join as join26, resolve as resolve3 } from "path";
15337
15401
 
@@ -15839,75 +15903,75 @@ var TerminalService = class {
15839
15903
  var terminalService = new TerminalService();
15840
15904
 
15841
15905
  // src/v1-routes.ts
15842
- var setWorkspaceNameSchema = z5.object({
15843
- name: z5.string().min(1).max(48)
15906
+ var setWorkspaceNameSchema = z6.object({
15907
+ name: z6.string().min(1).max(48)
15844
15908
  });
15845
- var imageMediaTypeSchema = z5.enum(IMAGE_MEDIA_TYPES);
15846
- var createPreviewSchema = z5.object({
15847
- port: z5.number().int().min(1).max(65535),
15848
- publicUrl: z5.string().min(1)
15909
+ var imageMediaTypeSchema = z6.enum(IMAGE_MEDIA_TYPES);
15910
+ var createPreviewSchema = z6.object({
15911
+ port: z6.number().int().min(1).max(65535),
15912
+ publicUrl: z6.string().min(1)
15849
15913
  });
15850
- var terminalSizeSchema = z5.object({
15851
- cols: z5.number().int().min(2).max(500),
15852
- rows: z5.number().int().min(1).max(200)
15914
+ var terminalSizeSchema = z6.object({
15915
+ cols: z6.number().int().min(2).max(500),
15916
+ rows: z6.number().int().min(1).max(200)
15853
15917
  });
15854
- var writeTerminalSessionSchema = z5.object({
15855
- data: z5.string().max(64 * 1024),
15856
- generation: z5.number().int().nonnegative(),
15857
- sequence: z5.number().int().nonnegative()
15918
+ var writeTerminalSessionSchema = z6.object({
15919
+ data: z6.string().max(64 * 1024),
15920
+ generation: z6.number().int().nonnegative(),
15921
+ sequence: z6.number().int().nonnegative()
15858
15922
  });
15859
- var sendMessageSchema = z5.object({
15860
- messageId: z5.string().min(1).optional(),
15861
- submittedAt: z5.string().datetime().optional(),
15862
- message: z5.string().min(1),
15863
- model: z5.string().optional(),
15864
- customInstructions: z5.string().optional(),
15865
- planMode: z5.boolean().optional(),
15866
- images: z5.array(z5.object({
15867
- type: z5.literal("image"),
15868
- source: z5.union([
15869
- z5.object({
15870
- type: z5.literal("base64"),
15923
+ var sendMessageSchema = z6.object({
15924
+ messageId: z6.string().min(1).optional(),
15925
+ submittedAt: z6.string().datetime().optional(),
15926
+ message: z6.string().min(1),
15927
+ model: z6.string().optional(),
15928
+ customInstructions: z6.string().optional(),
15929
+ planMode: z6.boolean().optional(),
15930
+ images: z6.array(z6.object({
15931
+ type: z6.literal("image"),
15932
+ source: z6.union([
15933
+ z6.object({
15934
+ type: z6.literal("base64"),
15871
15935
  media_type: imageMediaTypeSchema,
15872
- data: z5.string().min(1)
15936
+ data: z6.string().min(1)
15873
15937
  }),
15874
- z5.object({
15875
- type: z5.literal("url"),
15876
- url: z5.string().url()
15938
+ z6.object({
15939
+ type: z6.literal("url"),
15940
+ url: z6.string().url()
15877
15941
  })
15878
15942
  ])
15879
15943
  })).optional(),
15880
- thinkingLevel: z5.enum(VALID_THINKING_LEVELS).optional(),
15881
- goalMode: z5.boolean().optional(),
15882
- fastMode: z5.boolean().optional(),
15883
- enableInteractiveTools: z5.boolean().optional(),
15884
- type: z5.string().min(1).optional(),
15885
- merge: z5.boolean().optional(),
15886
- idempotencyKey: z5.string().min(1).max(128).optional(),
15887
- senderUserId: z5.string().optional(),
15888
- senderEmail: z5.string().optional(),
15889
- senderDisplayName: z5.string().optional(),
15890
- senderAvatarUrl: z5.string().optional(),
15891
- errorNotificationTarget: z5.discriminatedUnion("type", [
15892
- z5.object({ type: z5.literal("slack") }),
15893
- z5.object({ type: z5.literal("linear"), sessionId: z5.string().min(1) }),
15894
- z5.object({
15895
- type: z5.literal("code_host"),
15896
- provider: z5.enum(["github", "gitlab"]),
15897
- resource: z5.enum(["issue", "pull_request"]),
15898
- repositoryId: z5.string().min(1),
15899
- resourceNumber: z5.number().int().positive()
15944
+ thinkingLevel: z6.enum(VALID_THINKING_LEVELS).optional(),
15945
+ goalMode: z6.boolean().optional(),
15946
+ fastMode: z6.boolean().optional(),
15947
+ enableInteractiveTools: z6.boolean().optional(),
15948
+ type: z6.string().min(1).optional(),
15949
+ merge: z6.boolean().optional(),
15950
+ idempotencyKey: z6.string().min(1).max(128).optional(),
15951
+ senderUserId: z6.string().optional(),
15952
+ senderEmail: z6.string().optional(),
15953
+ senderDisplayName: z6.string().optional(),
15954
+ senderAvatarUrl: z6.string().optional(),
15955
+ errorNotificationTarget: z6.discriminatedUnion("type", [
15956
+ z6.object({ type: z6.literal("slack") }),
15957
+ z6.object({ type: z6.literal("linear"), sessionId: z6.string().min(1) }),
15958
+ z6.object({
15959
+ type: z6.literal("code_host"),
15960
+ provider: z6.enum(["github", "gitlab"]),
15961
+ resource: z6.enum(["issue", "pull_request"]),
15962
+ repositoryId: z6.string().min(1),
15963
+ resourceNumber: z6.number().int().positive()
15900
15964
  }),
15901
- z5.object({ type: z5.literal("automation"), executionId: z5.string().min(1) })
15965
+ z6.object({ type: z6.literal("automation"), executionId: z6.string().min(1) })
15902
15966
  ]).optional()
15903
15967
  });
15904
- var respondToolInputSchema = z5.object({
15905
- requestId: z5.string().min(1),
15906
- selectionId: z5.string().min(1)
15968
+ var respondToolInputSchema = z6.object({
15969
+ requestId: z6.string().min(1),
15970
+ selectionId: z6.string().min(1)
15907
15971
  });
15908
- var updateGoalSchema = z5.object({
15909
- objective: z5.string().trim().min(1).max(MAX_CODEX_GOAL_OBJECTIVE_CHARS).optional(),
15910
- status: z5.enum(["active", "paused"]).optional()
15972
+ var updateGoalSchema = z6.object({
15973
+ objective: z6.string().trim().min(1).max(MAX_CODEX_GOAL_OBJECTIVE_CHARS).optional(),
15974
+ status: z6.enum(["active", "paused"]).optional()
15911
15975
  }).refine((body) => body.objective !== void 0 || body.status !== void 0, {
15912
15976
  message: "Goal objective or status required"
15913
15977
  });
@@ -16098,7 +16162,7 @@ function createV1Routes(deps) {
16098
16162
  const result = await deps.chatService.updateGoal(c.req.param("chatId"), body);
16099
16163
  return c.json(result);
16100
16164
  } catch (error) {
16101
- if (error instanceof z5.ZodError) {
16165
+ if (error instanceof z6.ZodError) {
16102
16166
  return c.json(jsonError(error.issues[0]?.message || "Invalid goal update"), 400);
16103
16167
  }
16104
16168
  if (error instanceof ChatNotFoundError) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.470",
3
+ "version": "0.1.472",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",