replicas-engine 0.1.258 → 0.1.259

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 +15 -3
  2. package/package.json +1 -1
package/dist/src/index.js CHANGED
@@ -127,7 +127,7 @@ function detectLanguageByPath(filePath) {
127
127
 
128
128
  // ../shared/src/context-usage.ts
129
129
  var CODEX_CATEGORY_COLORS = {
130
- input: "#66bb6a",
130
+ input: "#3eeba3",
131
131
  output: "#56b6c2"
132
132
  };
133
133
  function clampPercentage(value) {
@@ -286,7 +286,7 @@ var WORKSPACE_SIZES = ["small", "large"];
286
286
  var INVALID_WORKSPACE_SIZE_ERROR = `Invalid size: must be one of ${WORKSPACE_SIZES.join(", ")}`;
287
287
 
288
288
  // ../shared/src/e2b.ts
289
- var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-06-03-v3";
289
+ var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-06-04-v1";
290
290
 
291
291
  // ../shared/src/runtime-env.ts
292
292
  function parsePosixEnvFile(content) {
@@ -1643,6 +1643,7 @@ var DEFAULT_DEFAULT_SKILLS = {
1643
1643
  };
1644
1644
 
1645
1645
  // ../shared/src/prompts.ts
1646
+ var MAX_CODEX_GOAL_OBJECTIVE_CHARS = 4e3;
1646
1647
  function parseGoalCommand(message) {
1647
1648
  const match = message.trim().match(/^\/goal(?:\s+([\s\S]*))?$/i);
1648
1649
  const value = match?.[1]?.trim();
@@ -1650,6 +1651,13 @@ function parseGoalCommand(message) {
1650
1651
  if (/^(clear|reset|unset)$/i.test(value)) return { type: "clear" };
1651
1652
  return { type: "set", objective: value };
1652
1653
  }
1654
+ function getGoalCommandObjectiveValidationError(message) {
1655
+ const command = parseGoalCommand(message);
1656
+ if (command?.type !== "set") return null;
1657
+ const length = command.objective.length;
1658
+ if (length <= MAX_CODEX_GOAL_OBJECTIVE_CHARS) return null;
1659
+ return `Goal objective must be at most ${MAX_CODEX_GOAL_OBJECTIVE_CHARS} characters (${length} provided). Shorten the /goal objective, or send the extra details as a regular message after setting the goal.`;
1660
+ }
1653
1661
 
1654
1662
  // ../shared/src/replicas-config.ts
1655
1663
  import { parse as parseYaml } from "yaml";
@@ -6341,7 +6349,7 @@ var AspClient = class {
6341
6349
  // src/managers/codex-asp/app-server-process.ts
6342
6350
  var DEFAULT_CODEX_BINARY = "codex";
6343
6351
  var DEFAULT_CODEX_ARGS = ["app-server", "--listen", "stdio://"];
6344
- var ENGINE_PACKAGE_VERSION = "0.1.258";
6352
+ var ENGINE_PACKAGE_VERSION = "0.1.259";
6345
6353
  var INITIALIZE_METHOD = "initialize";
6346
6354
  var INITIALIZED_NOTIFICATION = "initialized";
6347
6355
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -10516,6 +10524,10 @@ function createV1Routes(deps) {
10516
10524
  app2.post("/chats/:chatId/messages", async (c) => {
10517
10525
  try {
10518
10526
  const body = sendMessageSchema.parse(await c.req.json());
10527
+ const goalValidationError = getGoalCommandObjectiveValidationError(body.message);
10528
+ if (goalValidationError) {
10529
+ return c.json(jsonError(goalValidationError), 400);
10530
+ }
10519
10531
  const result = await deps.chatService.sendMessage(c.req.param("chatId"), body);
10520
10532
  return c.json(result);
10521
10533
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.258",
3
+ "version": "0.1.259",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",