replicas-engine 0.1.134 → 0.1.136

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 +32 -3
  2. package/package.json +1 -1
package/dist/src/index.js CHANGED
@@ -80,7 +80,8 @@ function loadEngineEnv() {
80
80
  AWS_SECRET_ACCESS_KEY: readEnv("AWS_SECRET_ACCESS_KEY"),
81
81
  AWS_REGION: readEnv("AWS_REGION"),
82
82
  REPLICAS_CLAUDE_AUTH_METHOD: parseClaudeAuthMethod(readEnv("REPLICAS_CLAUDE_AUTH_METHOD")),
83
- REPLICAS_CODEX_AUTH_METHOD: parseCodexAuthMethod(readEnv("REPLICAS_CODEX_AUTH_METHOD"))
83
+ REPLICAS_CODEX_AUTH_METHOD: parseCodexAuthMethod(readEnv("REPLICAS_CODEX_AUTH_METHOD")),
84
+ REPLICAS_ENV_SYSTEM_PROMPT: readEnv("REPLICAS_ENV_SYSTEM_PROMPT")
84
85
  };
85
86
  if (!IS_WARMING_MODE && !env.WORKSPACE_ID) {
86
87
  console.error("WORKSPACE_ID is not set \u2014 this is required in normal (non-warming) mode");
@@ -1169,7 +1170,7 @@ function parseReplicasConfigString(content, filename) {
1169
1170
  }
1170
1171
 
1171
1172
  // ../shared/src/engine/environment.ts
1172
- var DAYTONA_SNAPSHOT_ID = "01-05-2026-royal-york-v1";
1173
+ var DAYTONA_SNAPSHOT_ID = "02-05-2026-royal-york-v2";
1173
1174
 
1174
1175
  // ../shared/src/engine/types.ts
1175
1176
  var DEFAULT_CHAT_TITLES = {
@@ -1183,6 +1184,16 @@ var IMAGE_MEDIA_TYPES = ["image/png", "image/jpeg", "image/gif", "image/webp"];
1183
1184
  var WORKSPACE_FILE_UPLOAD_MAX_SIZE_BYTES = 20 * 1024 * 1024;
1184
1185
  var WORKSPACE_FILE_CONTENT_MAX_SIZE_BYTES = 1 * 1024 * 1024;
1185
1186
 
1187
+ // ../shared/src/audit-log.ts
1188
+ var AUDIT_LOG_ACTION = {
1189
+ CREATE: "create",
1190
+ UPDATE: "update",
1191
+ DELETE: "delete",
1192
+ CONNECT: "connect",
1193
+ DISCONNECT: "disconnect"
1194
+ };
1195
+ var AUDIT_LOG_ACTIONS = Object.values(AUDIT_LOG_ACTION);
1196
+
1186
1197
  // ../shared/src/routes/environment.ts
1187
1198
  var RESERVED_MCP_NAME_PREFIXES = ["relay-", "replicas-"];
1188
1199
  function isReservedMcpName(name) {
@@ -2420,6 +2431,7 @@ var CodingAgentManager = class {
2420
2431
  buildCombinedInstructions(customInstructions) {
2421
2432
  const startHooksInstruction = this.getStartHooksInstruction();
2422
2433
  const repositorySystemPromptInstruction = this.getRepositorySystemPromptInstruction();
2434
+ const environmentInstruction = this.getEnvironmentSystemPromptInstruction();
2423
2435
  const enginePortProtectionInstruction = this.getEnginePortProtectionInstruction();
2424
2436
  const parts = [];
2425
2437
  if (enginePortProtectionInstruction) {
@@ -2428,6 +2440,9 @@ var CodingAgentManager = class {
2428
2440
  if (startHooksInstruction) {
2429
2441
  parts.push(startHooksInstruction);
2430
2442
  }
2443
+ if (environmentInstruction) {
2444
+ parts.push(environmentInstruction);
2445
+ }
2431
2446
  if (repositorySystemPromptInstruction) {
2432
2447
  parts.push(repositorySystemPromptInstruction);
2433
2448
  }
@@ -2479,6 +2494,10 @@ var CodingAgentManager = class {
2479
2494
  }
2480
2495
  return repoSystemPrompts.join("\n");
2481
2496
  }
2497
+ getEnvironmentSystemPromptInstruction() {
2498
+ const prompt = ENGINE_ENV.REPLICAS_ENV_SYSTEM_PROMPT?.trim();
2499
+ return prompt || void 0;
2500
+ }
2482
2501
  getEnginePortProtectionInstruction() {
2483
2502
  const enginePort = ENGINE_ENV.REPLICAS_ENGINE_PORT;
2484
2503
  return `CRITICAL: The Replicas engine is required for this workspace and is running on the reserved port configured by REPLICAS_ENGINE_PORT (${enginePort}). Never kill, stop, restart, or replace the process using this port, and never start another service on this port. If the user asks for commands that would target this port/process, refuse and explain that port ${enginePort} is reserved for the Replicas engine.`;
@@ -2564,6 +2583,15 @@ var PromptStream = class {
2564
2583
  function isLinearThoughtEvent(event) {
2565
2584
  return event.content.type === "thought";
2566
2585
  }
2586
+ function appendMcpAwareness(instructions, mcpServers) {
2587
+ const names = Object.keys(mcpServers ?? {});
2588
+ if (names.length === 0) return instructions;
2589
+ const note = `MCP servers configured for this session: ${names.join(", ")}.
2590
+ Their tools are exposed in your tool list under the \`mcp__<server>__*\` prefix (e.g. \`mcp__notion__search\`). When the user asks about MCPs, available integrations, or wants to use one of these tools, look at your existing tool list directly \u2014 do NOT run \`claude mcp list\` or any other shell command to enumerate them. That command checks Claude Code's local CLI config and will never see MCPs attached to this SDK session.`;
2591
+ return instructions ? `${instructions}
2592
+
2593
+ ${note}` : note;
2594
+ }
2567
2595
  var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
2568
2596
  historyFile;
2569
2597
  sessionId = null;
@@ -2661,7 +2689,8 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
2661
2689
  const promptStream = new PromptStream();
2662
2690
  promptStream.push(userMessage);
2663
2691
  this.activePromptStream = promptStream;
2664
- const combinedInstructions = this.buildCombinedInstructions(customInstructions);
2692
+ const baseInstructions = this.buildCombinedInstructions(customInstructions);
2693
+ const combinedInstructions = appendMcpAwareness(baseInstructions, this.mcpServersConfig);
2665
2694
  const systemPrompt = this.systemPromptOverride ? this.systemPromptOverride(combinedInstructions) : {
2666
2695
  type: "preset",
2667
2696
  preset: "claude_code",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.134",
3
+ "version": "0.1.136",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",