replicas-engine 0.1.706 → 0.1.708

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.
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  HOOK_EXEC_MAX_BUFFER_BYTES,
4
4
  isVersionBelow
5
- } from "./chunk-WJ4UV3XF.js";
5
+ } from "./chunk-QDZIXXSR.js";
6
6
 
7
7
  // src/utils/presigned-upload.ts
8
8
  import { createReadStream } from "fs";
@@ -267,7 +267,7 @@ var DEFAULT_CODEX_ARGS = [
267
267
  var MIN_CODEX_CLI_VERSION = "0.144.6";
268
268
  var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
269
269
  var codexCliVersionEnsured = null;
270
- var ENGINE_PACKAGE_VERSION = "0.1.706";
270
+ var ENGINE_PACKAGE_VERSION = "0.1.708";
271
271
  var INITIALIZE_METHOD = "initialize";
272
272
  var INITIALIZED_NOTIFICATION = "initialized";
273
273
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  mayCreatePullRequest
4
- } from "./chunk-WJ4UV3XF.js";
4
+ } from "./chunk-QDZIXXSR.js";
5
5
 
6
6
  // src/services/post-tool-pr-notifier.ts
7
7
  async function notifyPostToolUse(toolName, toolInput) {
@@ -12,7 +12,7 @@ import {
12
12
  isValidAgentProvider,
13
13
  parsePosixEnvFile,
14
14
  readReplicasRuntimeEnv
15
- } from "./chunk-WJ4UV3XF.js";
15
+ } from "./chunk-QDZIXXSR.js";
16
16
 
17
17
  // src/engine-env.ts
18
18
  import { readFileSync as readFileSync2 } from "fs";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  evaluateCommandProtection
4
- } from "./chunk-DKB6GU6O.js";
4
+ } from "./chunk-RQHIQ4DW.js";
5
5
  import {
6
6
  isRecord
7
7
  } from "./chunk-2RB7SIP3.js";
8
- import "./chunk-WJ4UV3XF.js";
8
+ import "./chunk-QDZIXXSR.js";
9
9
 
10
10
  // src/command-protection-hook.ts
11
11
  var provider = process.argv[2];
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  evaluateCommandProtection
4
- } from "./chunk-DKB6GU6O.js";
4
+ } from "./chunk-RQHIQ4DW.js";
5
5
  import {
6
6
  notifyPostToolUse
7
- } from "./chunk-U3JCYNVR.js";
7
+ } from "./chunk-P3GKK2MO.js";
8
8
  import "./chunk-2RB7SIP3.js";
9
- import "./chunk-WJ4UV3XF.js";
9
+ import "./chunk-QDZIXXSR.js";
10
10
 
11
11
  // src/deepseek-command-protection-plugin.ts
12
12
  function replicasCommandProtection(context) {
@@ -4,12 +4,12 @@ import {
4
4
  buildCodexAgentEnv,
5
5
  putPresignedFile,
6
6
  recoverCompletedTurn
7
- } from "./chunk-2WU6ADFW.js";
7
+ } from "./chunk-JIRQ6WY3.js";
8
8
  import {
9
9
  AGENT,
10
10
  getMemoryOutputSafetyViolation,
11
11
  headlessAgentRequestSchema
12
- } from "./chunk-WJ4UV3XF.js";
12
+ } from "./chunk-QDZIXXSR.js";
13
13
 
14
14
  // src/headless-agent.ts
15
15
  import { createHash } from "crypto";
package/dist/src/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  monolithService,
9
9
  reportCommandProtectionBlock,
10
10
  setAgentCredentialSnapshot
11
- } from "./chunk-DKB6GU6O.js";
11
+ } from "./chunk-RQHIQ4DW.js";
12
12
  import {
13
13
  ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
14
14
  AGENT_MESSAGE_DELTA_METHOD,
@@ -35,7 +35,7 @@ import {
35
35
  execFileAsync,
36
36
  putPresignedFile,
37
37
  recoverCompletedTurn
38
- } from "./chunk-2WU6ADFW.js";
38
+ } from "./chunk-JIRQ6WY3.js";
39
39
  import {
40
40
  isRecord as isRecord2
41
41
  } from "./chunk-2RB7SIP3.js";
@@ -211,7 +211,7 @@ import {
211
211
  shellQuotePosix,
212
212
  stripAgentDiagnosticErrors,
213
213
  withTimeout
214
- } from "./chunk-WJ4UV3XF.js";
214
+ } from "./chunk-QDZIXXSR.js";
215
215
 
216
216
  // src/index.ts
217
217
  import { serve } from "@hono/node-server";
@@ -6559,6 +6559,7 @@ var CodexAspManager = class extends CodingAgentManager {
6559
6559
  currentThreadId = null;
6560
6560
  activeTurnId = null;
6561
6561
  threadAttached = false;
6562
+ attachedDeveloperInstructions = null;
6562
6563
  historyFile;
6563
6564
  codexAspTranscript = null;
6564
6565
  lastEmittedTranscripts = /* @__PURE__ */ new Map();
@@ -6956,7 +6957,7 @@ var CodexAspManager = class extends CodingAgentManager {
6956
6957
  await this.applySkillRegistries(host);
6957
6958
  const existingThreadId = this.currentThreadId;
6958
6959
  if (existingThreadId) {
6959
- if (!this.threadAttached) {
6960
+ if (!this.threadAttached || (developerInstructions ?? null) !== this.attachedDeveloperInstructions) {
6960
6961
  const serviceTier2 = await this.resolveRequestedServiceTier(host, request);
6961
6962
  const response = await host.client.request(
6962
6963
  THREAD_RESUME_METHOD,
@@ -6965,6 +6966,7 @@ var CodexAspManager = class extends CodingAgentManager {
6965
6966
  this.currentThreadId = response.thread.id;
6966
6967
  this.activeServiceTier = response.serviceTier;
6967
6968
  this.threadAttached = true;
6969
+ this.attachedDeveloperInstructions = developerInstructions ?? null;
6968
6970
  this.seedHistoryFromThread(response.thread);
6969
6971
  await this.onSaveSessionId(this.currentThreadId);
6970
6972
  }
@@ -6979,6 +6981,7 @@ var CodexAspManager = class extends CodingAgentManager {
6979
6981
  this.currentThreadId = threadId;
6980
6982
  this.activeServiceTier = threadStartResponse.serviceTier;
6981
6983
  this.threadAttached = true;
6984
+ this.attachedDeveloperInstructions = developerInstructions ?? null;
6982
6985
  await this.onSaveSessionId(this.currentThreadId);
6983
6986
  return threadId;
6984
6987
  }
@@ -8864,6 +8867,7 @@ var AcpManager = class extends CodingAgentManager {
8864
8867
  connection = null;
8865
8868
  context = null;
8866
8869
  sessionId = null;
8870
+ deliveredInstructions = null;
8867
8871
  activeModel = null;
8868
8872
  activeThinkingLevel;
8869
8873
  planMode = false;
@@ -8997,6 +9001,7 @@ var AcpManager = class extends CodingAgentManager {
8997
9001
  mcpServers: []
8998
9002
  });
8999
9003
  this.sessionId = session.sessionId;
9004
+ this.deliveredInstructions = null;
9000
9005
  this.configOptions = session.configOptions ?? [];
9001
9006
  this.modes = session.modes ?? null;
9002
9007
  await this.onSaveSessionId(session.sessionId);
@@ -9214,13 +9219,23 @@ var AcpManager = class extends CodingAgentManager {
9214
9219
  await this.setConfig("model", model);
9215
9220
  await this.setThinking(request.thinkingLevel);
9216
9221
  await this.setMode(this.planMode);
9217
- const prompt = [{ type: "text", text: request.message }];
9222
+ const instructions = this.buildCombinedInstructions(request.customInstructions);
9223
+ const pending = instructions && instructions !== this.deliveredInstructions ? instructions : null;
9224
+ const prompt = [{
9225
+ type: "text",
9226
+ text: pending ? `<workspace-instructions>
9227
+ ${pending}
9228
+ </workspace-instructions>
9229
+
9230
+ ${request.message}` : request.message
9231
+ }];
9218
9232
  for (const image of request.images ?? []) {
9219
9233
  if (!this.capabilities.promptCapabilities?.image) throw new Error(`${this.acp.provider} does not advertise ACP image support.`);
9220
9234
  if (image.source.type !== "base64") throw new Error(`${this.acp.provider} requires uploaded images to be base64 encoded.`);
9221
9235
  prompt.push({ type: "image", mimeType: image.source.media_type, data: image.source.data });
9222
9236
  }
9223
9237
  const response = await context.request(methods.agent.session.prompt, { sessionId, prompt });
9238
+ if (pending) this.deliveredInstructions = pending;
9224
9239
  this.recordHistoryEvent("acp-turn-complete", {
9225
9240
  provider: this.acp.provider,
9226
9241
  stopReason: response.stopReason
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  notifyPostToolUse
4
- } from "./chunk-U3JCYNVR.js";
4
+ } from "./chunk-P3GKK2MO.js";
5
5
  import {
6
6
  isRecord
7
7
  } from "./chunk-2RB7SIP3.js";
8
- import "./chunk-WJ4UV3XF.js";
8
+ import "./chunk-QDZIXXSR.js";
9
9
 
10
10
  // src/post-tool-pr-hook.ts
11
11
  async function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.706",
3
+ "version": "0.1.708",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",