replicas-engine 0.1.1669 → 0.1.1671

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
  listCodexModelsForDetails,
9
9
  restartCodexAspHost,
10
10
  restartCodexAspHostIfRunning
11
- } from "./chunk-IH56QPAV.js";
12
- import "./chunk-5BDCGAEV.js";
13
- import "./chunk-LR637LW6.js";
14
- import "./chunk-2LX33VLS.js";
11
+ } from "./chunk-HDCQF7AQ.js";
12
+ import "./chunk-55OD2MGN.js";
13
+ import "./chunk-KJ6QPUJ6.js";
14
+ import "./chunk-3EYNKOGU.js";
15
15
  import "./chunk-UZSNFLDQ.js";
16
- import "./chunk-7QJH7SD2.js";
16
+ import "./chunk-D5SSZI5B.js";
17
17
  import "./chunk-VEQXQN22.js";
18
18
  export {
19
19
  CODEX_ULTRAFAST_SERVICE_TIER,
@@ -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-7QJH7SD2.js";
6
+ } from "./chunk-D5SSZI5B.js";
7
7
 
8
8
  // src/utils/exec.ts
9
9
  import { exec, execFile } from "child_process";
@@ -5,7 +5,7 @@ import {
5
5
  extractCommandProtectionCommandText,
6
6
  isRecord,
7
7
  parseCodeHostPrUrl
8
- } from "./chunk-7QJH7SD2.js";
8
+ } from "./chunk-D5SSZI5B.js";
9
9
 
10
10
  // src/services/published-pull-request-urls.ts
11
11
  function publishedPullRequestUrls(result) {
@@ -5,7 +5,7 @@ import {
5
5
  ENGINE_ENV,
6
6
  monolithRequest,
7
7
  runGitCommand
8
- } from "./chunk-5BDCGAEV.js";
8
+ } from "./chunk-55OD2MGN.js";
9
9
  import {
10
10
  COMMAND_PROTECTION_MAX_MESSAGE_FILE_BYTES,
11
11
  COMMAND_PROTECTION_REPO_GIT_ARGS,
@@ -18,7 +18,7 @@ import {
18
18
  parseCommandProtectionRequest,
19
19
  toCommandProtectionRepoState,
20
20
  withRetry
21
- } from "./chunk-7QJH7SD2.js";
21
+ } from "./chunk-D5SSZI5B.js";
22
22
 
23
23
  // src/services/command-protection-service.ts
24
24
  import { readFile, stat } from "fs/promises";
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  SUBPROCESS_MAX_BUFFER,
6
6
  execFileAsync
7
- } from "./chunk-2LX33VLS.js";
7
+ } from "./chunk-3EYNKOGU.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-7QJH7SD2.js";
24
+ } from "./chunk-D5SSZI5B.js";
25
25
 
26
26
  // src/runtime-env-loader.ts
27
27
  import { readFileSync } from "fs";
@@ -13526,7 +13526,7 @@ var GPU_ABILITY = {
13526
13526
 
13527
13527
  // ../shared/src/default-skills/replicas-agent/abilities/issues.ts
13528
13528
  var SECTION7 = `### Issues
13529
- Track work in Replicas Issues (\`REP-42\`), the shared to-do list of the people and agents in this organization, with \`replicas issue\` or the \`issue_*\` MCP tools.
13529
+ Track work in Replicas Issues (\`REP-42\`), the shared to-do list of the people and agents in this organization, with \`replicas issue\`.
13530
13530
 
13531
13531
  **Reference:** \`references/ISSUES.md\`
13532
13532
 
@@ -13539,7 +13539,7 @@ var REFERENCE7 = `# Replicas Issues
13539
13539
 
13540
13540
  Issues are how people and agents in this organization track work. Each has an identifier like \`REP-42\`, a title, a markdown description, a status, a priority, assignees (people and workspaces), subscribers, comments, linked pull requests, and an activity log. Pass the identifier everywhere an issue is asked for.
13541
13541
 
13542
- Use the CLI, or the matching \`issue_*\` MCP tools when you have them; both act as this workspace. Add \`--json\` to any command for machine-readable output.
13542
+ The CLI acts as this workspace. Add \`--json\` to any command for machine-readable output.
13543
13543
 
13544
13544
  \`\`\`bash
13545
13545
  replicas issue view REP-42 # description, comments, activity, pull requests
@@ -13552,6 +13552,7 @@ replicas issue update REP-42 --title "..." --description-file /tmp/desc.md
13552
13552
  replicas issue comment REP-42 "Ready for review: https://github.com/acme/app/pull/12"
13553
13553
  replicas issue comment REP-42 "Before and after" --attach /tmp/after.png
13554
13554
  replicas issue assign REP-42 alice@acme.com # a member's email, user ID, or a workspace ID; \`me\` is this workspace
13555
+ replicas issue unassign REP-42 alice@acme.com # they stay subscribed
13555
13556
  replicas issue subscribe REP-42 | unsubscribe REP-42
13556
13557
  replicas issue link-pr REP-42 https://github.com/acme/app/pull/12
13557
13558
  replicas issue relate REP-42 blocks REP-43 | duplicate_of REP-40
@@ -13578,7 +13579,7 @@ Read the event and act only when it asks something of you: a person's question o
13578
13579
 
13579
13580
  **Keep the description current**, the way a good PM does: when the scope or the plan changes, edit it rather than burying the change in comment 14. Comments are for progress, questions, and decisions.
13580
13581
 
13581
- **Ask a person** by assigning them and commenting with exactly what you need decided; mention them as \`@email\` in the comment. Their reply arrives as an \`<issue_event>\`.
13582
+ **Ask a person** by assigning them and commenting with exactly what you need decided; mention them as \`@email\` in the comment. Their reply arrives as an \`<issue_event>\`. Once they've answered, unassign them so the issue only shows as theirs while it needs them; they stay subscribed.
13582
13583
 
13583
13584
  **Split big work:** create sub-issues with \`--parent REP-42\`, one per pull request or separable piece, and link blockers with \`relate\`.
13584
13585
 
@@ -16133,15 +16134,28 @@ function stripAgentInstructionBlocks(text4) {
16133
16134
  else spans(prose, text4.length);
16134
16135
  return stripInstructionBlocksOutside(text4, quoted);
16135
16136
  }
16136
- var MANAGER_EVENT_CHAT_NOTE = `If a message the user typed in this turn is still unanswered, your final reply answers it and they see it. Otherwise they don't see text you write in this turn: if it brings something they asked for, or a blocker that needs them, send it with ${REPLICAS_MCP_TOOLS.sendToChat}; then update the board if its order, notes or overview changed, and end with a one-line note.`;
16137
+ var managerEventChatNote = (then) => `If a message the user typed in this turn is still unanswered, your final reply answers it and they see it. Otherwise they don't see text you write in this turn: if it brings something they asked for, or a blocker that needs them, send it with ${REPLICAS_MCP_TOOLS.sendToChat}; then ${then}end with a one-line note.`;
16138
+ var MANAGER_EVENT_CHAT_NOTE = managerEventChatNote("update the board if its order, notes or overview changed, and ");
16137
16139
  var BOARD_ANSWER_NOTE = "The user answered on the board.";
16140
+ var MANAGER_ISSUE_EVENT_CHAT_NOTE = managerEventChatNote("");
16141
+ var MERGE_RULE = `- When a pull request should merge once it's approved and CI passes, call \`${REPLICAS_MCP_TOOLS.mergeWhenReady}\`: Replicas merges it and sends \`merged\`, or \`needs_attention\` saying why it can't. Never watch CI or pull requests with \`gh\`, sleep loops or wait scripts, and merge one yourself only when the user wants it merged right away.`;
16142
+ var chatRule = (view, news) => `- The chat is like texting an assistant. In a turn the user typed, they see the text you write between tool calls as it streams, your final reply, what you send with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, and your \`${REPLICAS_MCP_TOOLS.setStatus}\` line, never your tool calls. Unless you can answer right away, open with one line on what you'll do first and roughly how long it takes. Then call \`${REPLICAS_MCP_TOOLS.setStatus}\` with a few words on your current step, such as "Reading the billing webhook", and again each time you move to a new step. Before your final reply, write only what they'd want to know now: ${news}. Never narrate tool calls or say you're still working. When they message you mid-turn, reply in one line before anything else, then fold it into your work. Write in a line or two with links and any media inline, and never restate ${view} in chat.`;
16138
16143
  var BOARD_RULES = `- The board in the Ships pane beside this chat is the user's one view of the work: one ticket per task they ask for, holding only that task's pull requests. Replicas fills in each ticket's title, summaries, section and pull requests from the task, the ship's reports and its pull requests, so never restate what a ticket shows, and correct one with \`${REPLICAS_MCP_TOOLS.updateBoard}\` only when it's wrong.
16139
16144
  - Keep the board organized with \`${REPLICAS_MCP_TOOLS.updateBoard}\`: tickets in order, most important first; one short note per ticket only when it adds something, such as "Merge after #12"; and one overview line on where the work as a whole stands. Archive tickets the user no longer needs.
16140
16145
  - Ask the user only for decisions you truly can't make. Make routine calls yourself, such as retries, small scope choices or test cleanup. For a question of your own, create a ticket with it; the user's answer comes to you here, marked "${BOARD_ANSWER_NOTE}". Answers to a ship's questions go straight to that ship.
16141
16146
  - A ship with open pull requests is not done when it sends \`finished\`: Replicas fixes their CI failures and review comments automatically, then sends \`ready\` or \`needs_attention\`. On \`needs_attention\`, direct the ship, or ask the user only if you can't decide.
16142
- - When a pull request should merge once it's approved and CI passes, call \`${REPLICAS_MCP_TOOLS.mergeWhenReady}\`: Replicas merges it and sends \`merged\`, or \`needs_attention\` saying why it can't. Never watch CI or pull requests with \`gh\`, sleep loops or wait scripts, and merge one yourself only when the user wants it merged right away.
16147
+ ${MERGE_RULE}
16143
16148
  - On every ship event and board answer, act with tools on whatever it unblocks, such as starting the next task once a pull request merges, and update the board if it changed. The user sees nothing you write in these turns unless a message they typed is still unanswered; otherwise reach them only with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, and only for what they'd want right now: a deliverable they asked for, with its media, links or answer; a blocker that needs them, also on the board; or a request of theirs being done. Never for status, such as "PR #12 merged" or "I asked the ship to\u2026". End the turn with a one-line note of what you did.
16144
- - The chat is like texting an assistant. In a turn the user typed, they see the text you write between tool calls as it streams, your final reply, what you send with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, and your \`${REPLICAS_MCP_TOOLS.setStatus}\` line, never your tool calls. Unless you can answer right away, open with one line on what you'll do first and roughly how long it takes. Then call \`${REPLICAS_MCP_TOOLS.setStatus}\` with a few words on your current step, such as "Reading the billing webhook", and again each time you move to a new step. Before your final reply, write only what they'd want to know now: a finding that changes the answer, a ship you started, or a decision you need. Never narrate tool calls or say you're still working. When they message you mid-turn, reply in one line before anything else, then fold it into your work. Write in a line or two with links and any media inline, and never restate the board in chat.
16149
+ ${chatRule("the board", "a finding that changes the answer, a ship you started, or a decision you need")}
16150
+ `;
16151
+ var ISSUE_RULES = `- Your work lives in issues in your slice of the organization's Issues, which the Issues tab beside this chat shows the user. Before delegating, turn a request into issues with \`replicas issue create\`: one per independent task, so five small bugs are five issues, and a parent with sub-issues for a big project. Reuse an issue the request is about; find it with \`replicas issue list\`. A title says what the task is about, never a ship, branch or pull request name.
16152
+ - Spawn ships with \`issue\`, and pass \`issue\` to \`${REPLICAS_MCP_TOOLS.messageSubagent}\` to point a ship at another one: it is assigned, subscribed and told. Several ships can share an issue. Replicas moves an issue to In progress when a ship starts it, In review when its pull request opens and Done when they merge, and ships comment their progress, so never restate what an issue shows. Order, reprioritize or cancel issues with \`replicas issue update\`.
16153
+ - You are subscribed to every issue in your slice: comments and changes by ships and people arrive as \`<issue_event>\` blocks. Act on them like ship events. Ships assigned to an issue get its comments too, so never relay a comment to them; pass it only to a ship that isn't on the issue.
16154
+ - Ask the user only for decisions you truly can't make. Make routine calls yourself, such as retries, small scope choices or test cleanup. For a decision or merge only they can give, assign them to the issue with \`replicas issue assign\` and comment the question with \`replicas issue comment\`; their reply comes back as an \`<issue_event>\`. Once they answer a question you asked, unassign them with \`replicas issue unassign\` so the issue leaves their "Assigned to you"; they stay subscribed. Ships ask and unassign for their own questions, so leave those to them.
16155
+ - A ship with open pull requests is not done when it sends \`finished\`: Replicas fixes their CI failures and review comments automatically, then sends \`ready\` or \`needs_attention\`. On \`needs_attention\`, direct the ship, or assign the user only if you can't decide. On \`ready\` for a pull request that needs a person's review, assign the user with a one-line comment.
16156
+ ${MERGE_RULE}
16157
+ - On every ship and issue event, act with tools on whatever it unblocks, such as starting the next task once a pull request merges. The user sees nothing you write in these turns unless a message they typed is still unanswered; otherwise reach them only with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, and only for what they'd want right now: a deliverable they asked for, with its media, links or answer; a blocker that needs them, also assigned to them on its issue; or a request of theirs being done. Never for status, such as "PR #12 merged" or "I asked the ship to\u2026". End the turn with a one-line note of what you did, or only \`No action needed.\` when an issue event needs nothing from you.
16158
+ ${chatRule("the Issues tab", "the issues you created, a ship you started, a finding that changes the answer, or a decision you need")}
16145
16159
  `;
16146
16160
  function splitTaggedBlock(text4, tag) {
16147
16161
  const match = text4?.match(new RegExp(`\\s*<${tag}>\\n([\\s\\S]*?)\\n</${tag}>`));
@@ -21548,7 +21562,7 @@ async function withRetry(label, fn, options) {
21548
21562
  }
21549
21563
 
21550
21564
  // ../shared/src/tensorlake.ts
21551
- var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-20-v17";
21565
+ var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-20-v19";
21552
21566
  var TENSORLAKE_DISK_MB = 100 * 1024;
21553
21567
 
21554
21568
  // ../shared/src/egress.ts
@@ -12,15 +12,15 @@ import {
12
12
  resolveDiffBase,
13
13
  runGitCommand,
14
14
  setAgentCredentialSnapshot
15
- } from "./chunk-5BDCGAEV.js";
15
+ } from "./chunk-55OD2MGN.js";
16
16
  import {
17
17
  AppServerProcess,
18
18
  buildCodexAgentEnv
19
- } from "./chunk-LR637LW6.js";
19
+ } from "./chunk-KJ6QPUJ6.js";
20
20
  import {
21
21
  SUBPROCESS_MAX_BUFFER,
22
22
  execFileAsync
23
- } from "./chunk-2LX33VLS.js";
23
+ } from "./chunk-3EYNKOGU.js";
24
24
  import {
25
25
  isRecord
26
26
  } from "./chunk-UZSNFLDQ.js";
@@ -61,7 +61,7 @@ import {
61
61
  shrunkImageSize,
62
62
  splitManagerInstructions,
63
63
  withTimeout
64
- } from "./chunk-7QJH7SD2.js";
64
+ } from "./chunk-D5SSZI5B.js";
65
65
 
66
66
  // src/managers/codex-token-manager.ts
67
67
  import { promises as fs } from "fs";
@@ -461,7 +461,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
461
461
  await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
462
462
  await this.applyCredentialsResponse(data);
463
463
  setAgentCredentialSnapshot("codex", data);
464
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-DTBU37TZ.js");
464
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-PKDNKKHF.js");
465
465
  await restartCodexAspHostIfRunning2();
466
466
  });
467
467
  await this.start(true);
@@ -483,7 +483,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
483
483
  const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
484
484
  await this.applyCredentialsResponse(data);
485
485
  if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
486
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-DTBU37TZ.js");
486
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-PKDNKKHF.js");
487
487
  await restartCodexAspHostIfRunning2();
488
488
  }
489
489
  setAgentCredentialSnapshot("codex", data);
@@ -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-2LX33VLS.js";
6
+ } from "./chunk-3EYNKOGU.js";
7
7
  import {
8
8
  isVersionBelow
9
- } from "./chunk-7QJH7SD2.js";
9
+ } from "./chunk-D5SSZI5B.js";
10
10
 
11
11
  // src/utils/codex-agent-env.ts
12
12
  function buildCodexAgentEnv(source = process.env) {
@@ -32,6 +32,8 @@ var DEFAULT_REQUEST_TIMEOUT_MS = 12e4;
32
32
  function hasOwn(record, key) {
33
33
  return Object.prototype.hasOwnProperty.call(record, key);
34
34
  }
35
+ var AspRequestTimeoutError = class extends Error {
36
+ };
35
37
  var AspClient = class {
36
38
  stdin;
37
39
  stdout;
@@ -71,7 +73,7 @@ var AspClient = class {
71
73
  const timeoutMs = opts?.timeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;
72
74
  const timer = timeoutMs > 0 ? setTimeout(() => {
73
75
  this.pending.delete(id);
74
- reject(new Error(`ASP request timed out for ${method}`));
76
+ reject(new AspRequestTimeoutError(`ASP request timed out for ${method}`));
75
77
  }, timeoutMs) : null;
76
78
  this.pending.set(id, { resolve, reject, method, timer });
77
79
  });
@@ -240,7 +242,7 @@ function getCodexModelProvider(method) {
240
242
  if (method === "foundry") return "azure";
241
243
  return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
242
244
  }
243
- var ENGINE_PACKAGE_VERSION = "0.1.1669";
245
+ var ENGINE_PACKAGE_VERSION = "0.1.1671";
244
246
  var INITIALIZE_METHOD = "initialize";
245
247
  var INITIALIZED_NOTIFICATION = "initialized";
246
248
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -324,7 +326,7 @@ var AppServerProcess = class {
324
326
  }
325
327
  });
326
328
  child.on("exit", (code, signal) => {
327
- this.client?.dispose();
329
+ this.client?.dispose(new Error(`the Codex app-server process exited (${signal ?? `code ${code}`})`));
328
330
  this.client = null;
329
331
  this.child = null;
330
332
  if (!this.shuttingDown) {
@@ -479,6 +481,7 @@ var AppServerProcess = class {
479
481
 
480
482
  export {
481
483
  buildCodexAgentEnv,
484
+ AspRequestTimeoutError,
482
485
  AspClient,
483
486
  getCodexModelProvider,
484
487
  AppServerProcess
@@ -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-LR637LW6.js";
6
+ } from "./chunk-KJ6QPUJ6.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-7QJH7SD2.js";
18
+ } from "./chunk-D5SSZI5B.js";
19
19
 
20
20
  // src/managers/codex-asp/notification-dispatch.ts
21
21
  var TURN_STARTED_METHOD = "turn/started";
@@ -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-HQWUF7L5.js";
7
- import "./chunk-5BDCGAEV.js";
8
- import "./chunk-2LX33VLS.js";
6
+ } from "./chunk-4KUQJQPT.js";
7
+ import "./chunk-55OD2MGN.js";
8
+ import "./chunk-3EYNKOGU.js";
9
9
  import {
10
10
  isRecord
11
11
  } from "./chunk-UZSNFLDQ.js";
12
- import "./chunk-7QJH7SD2.js";
12
+ import "./chunk-D5SSZI5B.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-77JPD27V.js";
17
+ } from "./chunk-SLFFVHAI.js";
18
18
  import {
19
19
  AppServerProcess,
20
20
  buildCodexAgentEnv
21
- } from "./chunk-LR637LW6.js";
22
- import "./chunk-2LX33VLS.js";
21
+ } from "./chunk-KJ6QPUJ6.js";
22
+ import "./chunk-3EYNKOGU.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-7QJH7SD2.js";
32
+ } from "./chunk-D5SSZI5B.js";
33
33
  import "./chunk-VEQXQN22.js";
34
34
 
35
35
  // src/headless-agent.ts