replicas-engine 0.1.1366 → 0.1.1368

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.
@@ -8,12 +8,12 @@ import {
8
8
  listRunningCodexModels,
9
9
  restartCodexAspHost,
10
10
  restartCodexAspHostIfRunning
11
- } from "./chunk-HCJALTXV.js";
12
- import "./chunk-NAUURMTI.js";
13
- import "./chunk-7ECXAYCQ.js";
14
- import "./chunk-UQSFDT3F.js";
11
+ } from "./chunk-HKQYPCM6.js";
12
+ import "./chunk-DCXPJOSS.js";
13
+ import "./chunk-BPNMSYS7.js";
14
+ import "./chunk-FNUXFVME.js";
15
15
  import "./chunk-UZSNFLDQ.js";
16
- import "./chunk-J5OORHEW.js";
16
+ import "./chunk-KFTYWPOT.js";
17
17
  import "./chunk-VEQXQN22.js";
18
18
  export {
19
19
  CODEX_ULTRAFAST_SERVICE_TIER,
@@ -3,10 +3,10 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  execFileAsync
6
- } from "./chunk-UQSFDT3F.js";
6
+ } from "./chunk-FNUXFVME.js";
7
7
  import {
8
8
  isVersionBelow
9
- } from "./chunk-J5OORHEW.js";
9
+ } from "./chunk-KFTYWPOT.js";
10
10
 
11
11
  // src/utils/codex-agent-env.ts
12
12
  function buildCodexAgentEnv(source = process.env) {
@@ -240,7 +240,7 @@ function getCodexModelProvider(method) {
240
240
  if (method === "foundry") return "azure";
241
241
  return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
242
242
  }
243
- var ENGINE_PACKAGE_VERSION = "0.1.1365";
243
+ var ENGINE_PACKAGE_VERSION = "0.1.1368";
244
244
  var INITIALIZE_METHOD = "initialize";
245
245
  var INITIALIZED_NOTIFICATION = "initialized";
246
246
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  SUBPROCESS_MAX_BUFFER,
6
6
  execFileAsync
7
- } from "./chunk-UQSFDT3F.js";
7
+ } from "./chunk-FNUXFVME.js";
8
8
  import {
9
9
  isRecord as isRecord2
10
10
  } from "./chunk-UZSNFLDQ.js";
@@ -21,7 +21,7 @@ import {
21
21
  provisionedDeviceSchema,
22
22
  readReplicasRuntimeEnv,
23
23
  serializePosixEnvFile
24
- } from "./chunk-J5OORHEW.js";
24
+ } from "./chunk-KFTYWPOT.js";
25
25
 
26
26
  // src/runtime-env-loader.ts
27
27
  import { readFileSync } from "fs";
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  HOOK_EXEC_MAX_BUFFER_BYTES
6
- } from "./chunk-J5OORHEW.js";
6
+ } from "./chunk-KFTYWPOT.js";
7
7
 
8
8
  // src/utils/exec.ts
9
9
  import { exec, execFile } from "child_process";
@@ -10,15 +10,15 @@ import {
10
10
  resolveDiffBase,
11
11
  runGitCommand,
12
12
  setAgentCredentialSnapshot
13
- } from "./chunk-NAUURMTI.js";
13
+ } from "./chunk-DCXPJOSS.js";
14
14
  import {
15
15
  AppServerProcess,
16
16
  buildCodexAgentEnv
17
- } from "./chunk-7ECXAYCQ.js";
17
+ } from "./chunk-BPNMSYS7.js";
18
18
  import {
19
19
  SUBPROCESS_MAX_BUFFER,
20
20
  execFileAsync
21
- } from "./chunk-UQSFDT3F.js";
21
+ } from "./chunk-FNUXFVME.js";
22
22
  import {
23
23
  isRecord
24
24
  } from "./chunk-UZSNFLDQ.js";
@@ -56,7 +56,7 @@ import {
56
56
  resolveOpenAICompatibleModelsUrl,
57
57
  splitMothershipInstructions,
58
58
  withTimeout
59
- } from "./chunk-J5OORHEW.js";
59
+ } from "./chunk-KFTYWPOT.js";
60
60
 
61
61
  // src/managers/codex-token-manager.ts
62
62
  import { promises as fs } from "fs";
@@ -319,7 +319,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
319
319
  await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
320
320
  await this.applyCredentialsResponse(data);
321
321
  setAgentCredentialSnapshot("codex", data);
322
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-N4RODAYX.js");
322
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-ZBA6NGOO.js");
323
323
  await restartCodexAspHostIfRunning2();
324
324
  });
325
325
  await this.start(true);
@@ -341,7 +341,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
341
341
  const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
342
342
  await this.applyCredentialsResponse(data);
343
343
  if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
344
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-N4RODAYX.js");
344
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-ZBA6NGOO.js");
345
345
  await restartCodexAspHostIfRunning2();
346
346
  }
347
347
  setAgentCredentialSnapshot("codex", data);
@@ -11194,6 +11194,12 @@ var mothershipSubagentSettingsSchema = z7.object({
11194
11194
  goal_mode: z7.boolean(),
11195
11195
  plan_mode: z7.boolean()
11196
11196
  });
11197
+ var QUEUE_SECTIONS = [
11198
+ { label: "Open PRs", groups: ["needs_you", "ready_to_merge", "ready_to_review"] },
11199
+ { label: "Working", groups: ["working"] },
11200
+ { label: "Shipping", groups: ["shipping"] }
11201
+ ];
11202
+ var MOTHERSHIP_QUEUE_GROUPS = QUEUE_SECTIONS.flatMap((section) => section.groups);
11197
11203
  var DEPLOYED_SHOWN_MS = 3 * 60 * 6e4;
11198
11204
  var MOTHERSHIP_SHIPPING_LOOKBACK_MS = 3 * 24 * 60 * 6e4;
11199
11205
 
@@ -14514,6 +14520,26 @@ There is no settings page: people change how you behave by telling you, and you
14514
14520
  - **Slack agent defaults.** To change the agent, model, thinking level, goal mode or fast mode used for tasks started from Slack ("use Codex for Slack tasks"), call \`${REPLICAS_MCP_TOOLS.setSlackAgentDefaults}\`; only an organization admin can.
14515
14521
  - **What can I change?** Read the current settings, then answer with a short list of what applies: how much you speak up here or in every channel (Mentions only, Low, Balanced, High; raising a channel above Mentions only and the every-channel default need an admin), instructions or a preset for this channel, sending this channel's requests to a Mothership, which Linear teams you triage (an admin starts one), and the agent defaults for Slack tasks (admin). Say each one's current value.`;
14516
14522
 
14523
+ // ../shared/src/message-origin.ts
14524
+ var UUID = UUID_RE.source.slice(1, -1);
14525
+ var WORKSPACE_SENDER = new RegExp(String.raw`^\s*<${REPLICAS_INSTRUCTIONS_TAG}>\nFrom the workspace ("(?:[^"\\\n]|\\.)*") \((${UUID})\)\.\n</${REPLICAS_INSTRUCTIONS_TAG}>`);
14526
+ var SCHEDULED_NOTE = "This is a message you or a teammate scheduled earlier, delivered into this workspace.";
14527
+ var SCHEDULED_FOLLOW_UP = new RegExp(String.raw`^\s*\*\*Scheduled follow-up: ([^\n]+)\*\*\n\nThe automation "[^\n]*" \((${UUID})\) fired at \S+\. ${SCHEDULED_NOTE.replace(/\./g, "\\.")}`);
14528
+ function parseMessageOrigin(raw) {
14529
+ const workspace = raw.match(WORKSPACE_SENDER);
14530
+ if (workspace) {
14531
+ let name;
14532
+ try {
14533
+ name = JSON.parse(workspace[1]);
14534
+ } catch {
14535
+ return null;
14536
+ }
14537
+ if (typeof name === "string") return { kind: "workspace", id: workspace[2], name, body: stripReplicasInstructionBlock(raw.slice(workspace[0].length)) };
14538
+ }
14539
+ const automation = raw.match(SCHEDULED_FOLLOW_UP);
14540
+ return automation ? { kind: "automation", id: automation[2], name: automation[1].trim(), body: stripReplicasInstructionBlock(raw.slice(automation[0].length)) } : null;
14541
+ }
14542
+
14517
14543
  // ../shared/src/mothership-events.ts
14518
14544
  var MOTHERSHIP_EVENT_KINDS = ["finished", "ready", "needs_attention", "merged", "closed", "archived"];
14519
14545
  var MOTHERSHIP_TURN_ERROR_SUMMARY = "Turn ended with an error.";
@@ -18074,10 +18100,12 @@ function filterDisplayMessages(messages, provider2) {
18074
18100
  }
18075
18101
  const cleaned = (msg.images?.length || files.length) && ATTACHMENT_PLACEHOLDER_REGEX.test(content) ? "" : content;
18076
18102
  if (cleaned.length === 0 && !msg.images?.length && files.length === 0 && walkthroughs.length === 0 && appshots.length === 0 && annotations.length === 0) return [];
18077
- if (cleaned === msg.content && files.length === 0 && walkthroughs.length === 0 && appshots.length === 0 && annotations.length === 0) return [msg];
18103
+ const origin = parseMessageOrigin(msg.content);
18104
+ if (cleaned === msg.content && !origin && files.length === 0 && walkthroughs.length === 0 && appshots.length === 0 && annotations.length === 0) return [msg];
18078
18105
  return [{
18079
18106
  ...msg,
18080
18107
  content: cleaned,
18108
+ ...origin ? { origin } : {},
18081
18109
  ...files.length > 0 ? { files } : {},
18082
18110
  ...walkthroughs.length > 0 ? { walkthroughs } : {},
18083
18111
  ...annotations.length > 0 ? { annotations } : {},
@@ -18095,6 +18123,8 @@ function attachSendersToMessages(messages, senders) {
18095
18123
  const userIndices = [];
18096
18124
  const attachSender = (message2, sender) => message2.type === "user" ? {
18097
18125
  ...message2,
18126
+ // Markers are plain text a person can copy, so a recorded person always wins over a ship or check-in marker.
18127
+ origin: void 0,
18098
18128
  senderUserId: sender.senderUserId,
18099
18129
  senderEmail: sender.senderEmail,
18100
18130
  ...sender.senderDisplayName ? { senderDisplayName: sender.senderDisplayName } : {},
@@ -6,7 +6,7 @@ import {
6
6
  getOriginDefaultBranch,
7
7
  monolithRequest,
8
8
  runGitCommand
9
- } from "./chunk-NAUURMTI.js";
9
+ } from "./chunk-DCXPJOSS.js";
10
10
  import {
11
11
  extractCommandProtectionCommandText,
12
12
  findCommandProtectionGitLookups,
@@ -14,7 +14,7 @@ import {
14
14
  findPrMergeSignals,
15
15
  findScoutRepoWriteSignals,
16
16
  parseCommandProtectionRequest
17
- } from "./chunk-J5OORHEW.js";
17
+ } from "./chunk-KFTYWPOT.js";
18
18
 
19
19
  // src/services/command-protection-service.ts
20
20
  import { readFile, stat } from "fs/promises";
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  AspClient
6
- } from "./chunk-7ECXAYCQ.js";
6
+ } from "./chunk-BPNMSYS7.js";
7
7
  import {
8
8
  ASTER_BASE_URL,
9
9
  ASTER_PROVIDER,
@@ -15,7 +15,7 @@ import {
15
15
  isRecord,
16
16
  readOllamaAuthEnv,
17
17
  readOpenAICompatibleAuthEnv
18
- } from "./chunk-J5OORHEW.js";
18
+ } from "./chunk-KFTYWPOT.js";
19
19
 
20
20
  // src/managers/codex-asp/notification-dispatch.ts
21
21
  var TURN_STARTED_METHOD = "turn/started";
@@ -5,7 +5,7 @@ import {
5
5
  extractCommandProtectionCommandText,
6
6
  isRecord,
7
7
  parseCodeHostPrUrl
8
- } from "./chunk-J5OORHEW.js";
8
+ } from "./chunk-KFTYWPOT.js";
9
9
 
10
10
  // src/services/published-pull-request-urls.ts
11
11
  function publishedPullRequestUrls(result) {
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  evaluateCommandProtection
6
- } from "./chunk-AG7S5LHR.js";
7
- import "./chunk-NAUURMTI.js";
8
- import "./chunk-UQSFDT3F.js";
6
+ } from "./chunk-KOM4F6NH.js";
7
+ import "./chunk-DCXPJOSS.js";
8
+ import "./chunk-FNUXFVME.js";
9
9
  import {
10
10
  isRecord
11
11
  } from "./chunk-UZSNFLDQ.js";
12
- import "./chunk-J5OORHEW.js";
12
+ import "./chunk-KFTYWPOT.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/command-protection-hook.ts
@@ -14,12 +14,12 @@ import {
14
14
  recoverCompletedTurn,
15
15
  spawnMuseMsp,
16
16
  startMuseSession
17
- } from "./chunk-7LCSIC3Y.js";
17
+ } from "./chunk-QL5FXFOQ.js";
18
18
  import {
19
19
  AppServerProcess,
20
20
  buildCodexAgentEnv
21
- } from "./chunk-7ECXAYCQ.js";
22
- import "./chunk-UQSFDT3F.js";
21
+ } from "./chunk-BPNMSYS7.js";
22
+ import "./chunk-FNUXFVME.js";
23
23
  import {
24
24
  AGENT,
25
25
  OPENCODE_GO_PROVIDER,
@@ -29,7 +29,7 @@ import {
29
29
  headlessAgentUsagePath,
30
30
  isRecord,
31
31
  withTimeout
32
- } from "./chunk-J5OORHEW.js";
32
+ } from "./chunk-KFTYWPOT.js";
33
33
  import "./chunk-VEQXQN22.js";
34
34
 
35
35
  // src/headless-agent.ts
package/dist/src/index.js CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  evaluateCommandProtection,
28
28
  extractToolCommand,
29
29
  reportCommandProtectionBlock
30
- } from "./chunk-AG7S5LHR.js";
30
+ } from "./chunk-KOM4F6NH.js";
31
31
  import {
32
32
  ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
33
33
  AGENT_MESSAGE_DELTA_METHOD,
@@ -65,10 +65,10 @@ import {
65
65
  spawnMuseMsp,
66
66
  startMuseSession,
67
67
  uuidV7
68
- } from "./chunk-7LCSIC3Y.js";
68
+ } from "./chunk-QL5FXFOQ.js";
69
69
  import {
70
70
  publishedPullRequestUrls
71
- } from "./chunk-625KVBFP.js";
71
+ } from "./chunk-XE2ZXDZD.js";
72
72
  import {
73
73
  ACCOUNT_RATE_LIMITS_READ_METHOD,
74
74
  AsyncLock,
@@ -143,7 +143,7 @@ import {
143
143
  timestampFromSeconds,
144
144
  upsertCredentialFileLines,
145
145
  writeSecureCredentialFile
146
- } from "./chunk-HCJALTXV.js";
146
+ } from "./chunk-HKQYPCM6.js";
147
147
  import {
148
148
  ENGINE_ENV,
149
149
  monolithRequest,
@@ -153,15 +153,15 @@ import {
153
153
  resolveDiffBase,
154
154
  setAgentCredentialSnapshot,
155
155
  setLinearSessionId
156
- } from "./chunk-NAUURMTI.js";
156
+ } from "./chunk-DCXPJOSS.js";
157
157
  import {
158
158
  getCodexModelProvider
159
- } from "./chunk-7ECXAYCQ.js";
159
+ } from "./chunk-BPNMSYS7.js";
160
160
  import {
161
161
  SUBPROCESS_MAX_BUFFER,
162
162
  execAsync,
163
163
  execFileAsync
164
- } from "./chunk-UQSFDT3F.js";
164
+ } from "./chunk-FNUXFVME.js";
165
165
  import {
166
166
  isRecord as isRecord2
167
167
  } from "./chunk-UZSNFLDQ.js";
@@ -422,7 +422,7 @@ import {
422
422
  workspaceTokenRequestSchema,
423
423
  workspaceTokenResponseSchema,
424
424
  wrapInTag
425
- } from "./chunk-J5OORHEW.js";
425
+ } from "./chunk-KFTYWPOT.js";
426
426
  import {
427
427
  cloneMcpConfig,
428
428
  ensureCompatibilityImports,
@@ -12983,6 +12983,7 @@ var COMMAND_PROTECTION_SAFE_TOOLS = /* @__PURE__ */ new Set([
12983
12983
  "WebFetch",
12984
12984
  "LS"
12985
12985
  ]);
12986
+ var CLAUDE_STOPPED_TOOL_RESULT = "The user doesn't want to proceed with this tool use. The tool use was rejected (eg. if it was a file edit, the new_string was NOT written to the file). STOP what you are doing";
12986
12987
  var CLAUDE_PARTIAL_MESSAGE_FLUSH_MS = 80;
12987
12988
  var CLAUDE_SLASH_COMMANDS_CACHE_MS = 6e4;
12988
12989
  var CLAUDE_SLASH_COMMANDS_DISCOVERY_TIMEOUT_MS = 3e4;
@@ -13816,7 +13817,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
13816
13817
  const notedCutOffs = [...this.cutOffTools.keys()];
13817
13818
  const cutOffNote = notedCutOffs.length > 0 ? [{
13818
13819
  type: "text",
13819
- text: wrapInTag(`The user interrupted your last turn, cutting off these tool calls before they returned: ${[...new Set(this.cutOffTools.values())].map((name) => `\`${name}\``).join(", ")}. Nobody rejected them, whatever their results say. They may or may not have taken effect, so check before relying on or repeating them.`, REPLICAS_INSTRUCTIONS_TAG)
13820
+ text: wrapInTag(`The user pressed Stop while these tool calls were running: ${[...new Set(this.cutOffTools.values())].map((name) => `\`${name}\``).join(", ")}. Claude Code reports a call cut off this way as "The user doesn't want to proceed with this tool use. The tool use was rejected", but nobody rejected or declined them: they were stopped mid-run. Describe them as stopped or interrupted, never as rejected. They may or may not have taken effect, so check before relying on or repeating them.`, REPLICAS_INSTRUCTIONS_TAG)
13820
13821
  }] : [];
13821
13822
  const dropNotedCutOffs = () => {
13822
13823
  for (const id of notedCutOffs) this.cutOffTools.delete(id);
@@ -14081,7 +14082,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
14081
14082
  if (block.type !== "tool_result") continue;
14082
14083
  const name = this.runningTools.get(block.tool_use_id);
14083
14084
  this.runningTools.delete(block.tool_use_id);
14084
- if (name && this.pendingInterrupt && block.is_error) this.cutOffTools.set(block.tool_use_id, name);
14085
+ if (name && this.pendingInterrupt && block.is_error && extractToolResultText(block.content, "").startsWith(CLAUDE_STOPPED_TOOL_RESULT)) this.cutOffTools.set(block.tool_use_id, name);
14085
14086
  }
14086
14087
  }
14087
14088
  if (this.pendingInterrupt) {
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  publishedPullRequestUrls
6
- } from "./chunk-625KVBFP.js";
6
+ } from "./chunk-XE2ZXDZD.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-UZSNFLDQ.js";
10
10
  import {
11
11
  shouldRefreshPullRequests
12
- } from "./chunk-J5OORHEW.js";
12
+ } from "./chunk-KFTYWPOT.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/services/post-tool-pr-notifier.ts
@@ -11,7 +11,7 @@ import {
11
11
  spawnSubagentRequestSchema,
12
12
  subagentResponseSchema,
13
13
  waitSubagentRequestSchema
14
- } from "./chunk-J5OORHEW.js";
14
+ } from "./chunk-KFTYWPOT.js";
15
15
  import "./chunk-VEQXQN22.js";
16
16
 
17
17
  // src/subagent-mcp.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.1366",
3
+ "version": "0.1.1368",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",