replicas-engine 0.1.1619 → 0.1.1621

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-JHJCT5XG.js";
12
- import "./chunk-DFT2HMHS.js";
13
- import "./chunk-VPYWQZU5.js";
14
- import "./chunk-CIIXI7DT.js";
11
+ } from "./chunk-YT6WV6IO.js";
12
+ import "./chunk-FC5YLKZF.js";
13
+ import "./chunk-KT4MUSIR.js";
14
+ import "./chunk-RJIL6AHL.js";
15
15
  import "./chunk-UZSNFLDQ.js";
16
- import "./chunk-SRZOQNU6.js";
16
+ import "./chunk-A3W36FF5.js";
17
17
  import "./chunk-VEQXQN22.js";
18
18
  export {
19
19
  CODEX_ULTRAFAST_SERVICE_TIER,
@@ -9720,7 +9720,7 @@ function serviceTierRequestFields(tier) {
9720
9720
  return { fastMode: tier !== "default", ...tier === "ultrafast" ? { ultrafastMode: true } : {} };
9721
9721
  }
9722
9722
  var mothershipSubagentSettingsSchema = z4.object({
9723
- coding_agent: z4.enum(ENGINE_AGENT_PROVIDERS),
9723
+ coding_agent: z4.enum(VALID_AGENT_PROVIDERS),
9724
9724
  model: z4.string().nullable(),
9725
9725
  thinking_level: z4.enum(VALID_THINKING_LEVELS).nullable(),
9726
9726
  service_tier: z4.enum(SUBAGENT_SERVICE_TIERS),
@@ -17260,10 +17260,22 @@ import { z as z31 } from "zod";
17260
17260
  var ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
17261
17261
  var withoutAttachmentPlaceholder = (content, attached) => attached && ATTACHMENT_PLACEHOLDER_REGEX.test(content) ? "" : content;
17262
17262
  var annotationLinesSchema = z31.object({ path: z31.string(), start: z31.number(), end: z31.number() });
17263
+ var messageAnnotationSchema = z31.object({
17264
+ text: z31.string(),
17265
+ comment: z31.string().optional(),
17266
+ lines: annotationLinesSchema.optional(),
17267
+ /** Which match of `text` in its message was quoted, from 0, when the same words appear more than once. */
17268
+ occurrence: z31.number().int().nonnegative().optional(),
17269
+ /** The rendered message the quote was selected in, and its last one when it spans several, so clients find it without searching. */
17270
+ messageId: z31.string().optional(),
17271
+ endMessageId: z31.string().optional()
17272
+ });
17263
17273
  var ANNOTATIONS_NOTE_OPENING = '<replicas_annotations>\nThe user quoted these passages, some with a comment. Address each annotation, and when you do, refer to it as "Annotation N".';
17264
17274
  var ANNOTATIONS_NOTE_REGEX = /(?:^|\n\n)<replicas_annotations>\n([\s\S]*?)\n<\/replicas_annotations>$/;
17265
17275
  var ANNOTATION_HEADER_REGEX = /^Annotation \d+$/m;
17266
17276
  var ANNOTATION_FILE_REGEX = /^File: (.+):(\d+)(?:-(\d+))?$/;
17277
+ var ANNOTATION_OCCURRENCE_REGEX = /^Occurrence: (\d+) /;
17278
+ var ANNOTATION_SOURCE_REGEX = /^Source: (\S+)(?: to (\S+))?$/;
17267
17279
  function findAnnotationsNote(content) {
17268
17280
  const complete = content.match(ANNOTATIONS_NOTE_REGEX);
17269
17281
  if (complete) return { index: complete.index ?? 0, body: complete[1] };
@@ -17278,13 +17290,19 @@ function parseAnnotationsNote(body) {
17278
17290
  const lines = entry.trim().split("\n");
17279
17291
  const file = lines[0]?.match(ANNOTATION_FILE_REGEX);
17280
17292
  if (file) lines.shift();
17293
+ const source = lines[0]?.match(ANNOTATION_SOURCE_REGEX);
17294
+ if (source) lines.shift();
17295
+ const occurrence = lines[0]?.match(ANNOTATION_OCCURRENCE_REGEX);
17296
+ if (occurrence) lines.shift();
17281
17297
  const quoteLength = lines.findIndex((line) => !line.startsWith(">"));
17282
17298
  const quote = lines.slice(0, quoteLength === -1 ? void 0 : quoteLength).map((line) => line.replace(/^>\s?/, ""));
17283
17299
  const comment = quoteLength === -1 ? "" : lines.slice(quoteLength).join("\n").trim();
17284
17300
  return {
17285
17301
  text: quote.join("\n"),
17286
17302
  ...comment ? { comment } : {},
17287
- ...file ? { lines: { path: file[1], start: Number(file[2]), end: Number(file[3] ?? file[2]) } } : {}
17303
+ ...file ? { lines: { path: file[1], start: Number(file[2]), end: Number(file[3] ?? file[2]) } } : {},
17304
+ ...occurrence ? { occurrence: Number(occurrence[1]) - 1 } : {},
17305
+ ...source ? { messageId: source[1], ...source[2] ? { endMessageId: source[2] } : {} } : {}
17288
17306
  };
17289
17307
  });
17290
17308
  }
@@ -20660,7 +20678,7 @@ var VOICE_WAVEFORM = {
20660
20678
  };
20661
20679
 
20662
20680
  // ../shared/src/e2b.ts
20663
- var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-17-v17";
20681
+ var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-17-v19";
20664
20682
 
20665
20683
  // ../shared/src/e2b-retry.ts
20666
20684
  var DEFAULT_BACKOFFS_MS = [2e3, 5e3];
@@ -21283,8 +21301,10 @@ var harnessInboxPayloadSchemas = {
21283
21301
  model: z32.string().optional(),
21284
21302
  thinkingLevel: z32.enum(VALID_THINKING_LEVELS).optional(),
21285
21303
  instructionsHash: z32.string().optional(),
21304
+ queued: z32.boolean().optional(),
21286
21305
  /** Stored only on a message whose `instructionsHash` differs from the message before it; later ones find it by hash. */
21287
- instructions: z32.object({ environmentSystemPrompt: z32.string().optional(), customInstructions: z32.string().optional() }).optional()
21306
+ instructions: z32.object({ environmentSystemPrompt: z32.string().optional(), customInstructions: z32.string().optional() }).optional(),
21307
+ errorNotificationTarget: integrationErrorNotificationTargetSchema.optional()
21288
21308
  }),
21289
21309
  interrupt: z32.looseObject({ userId: z32.string().nullable() })
21290
21310
  };
@@ -21335,6 +21355,7 @@ var harnessWorkerCredentialResponseSchema = z33.discriminatedUnion("method", [
21335
21355
  z33.object({ method: z33.literal("oauth"), accessToken: z33.string(), expiresAt: z33.string(), credential: agentCredentialSnapshotSchema }),
21336
21356
  z33.object({ method: z33.literal("api_key"), apiKey: z33.string(), credential: agentCredentialSnapshotSchema })
21337
21357
  ]);
21358
+ var harnessWorkerTurnCompleteRequestSchema = z33.object({ errors: z33.array(z33.string()) });
21338
21359
 
21339
21360
  // ../shared/src/auth-errors.ts
21340
21361
  var AUTHENTICATION_ERROR_PATTERNS = [
@@ -22024,7 +22045,7 @@ var scoutDeleteChannelPresetToolInputSchema = scoutSettingsConfirmationSchema.ex
22024
22045
  var RESET_TO_DEFAULT = "default";
22025
22046
  var resettable = (schema, description) => z36.union([schema, z36.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
22026
22047
  var scoutSetSlackAgentDefaultsToolInputSchema = scoutSettingsConfirmationSchema.extend({
22027
- agent_provider: resettable(z36.enum(ENGINE_AGENT_PROVIDERS), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
22048
+ agent_provider: resettable(z36.enum(VALID_AGENT_PROVIDERS), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
22028
22049
  model: resettable(z36.string(), "Model id for that agent; the default is the agent's own."),
22029
22050
  thinking_level: resettable(z36.enum(VALID_THINKING_LEVELS), "Thinking level."),
22030
22051
  goal_mode: resettable(z36.boolean(), "Goal mode."),
@@ -22548,7 +22569,7 @@ var sendPullRequestReviewMessageRequestSchema = z42.object({
22548
22569
  }).shape,
22549
22570
  /** Starts a new chat instead of continuing the PR's review chat. The provider only applies to a new chat. */
22550
22571
  newChat: z42.boolean().optional(),
22551
- provider: z42.enum(ENGINE_AGENT_PROVIDERS).optional()
22572
+ provider: z42.enum(VALID_AGENT_PROVIDERS).optional()
22552
22573
  });
22553
22574
 
22554
22575
  // ../shared/src/audit-log.ts
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  SUBPROCESS_MAX_BUFFER,
6
6
  execFileAsync
7
- } from "./chunk-CIIXI7DT.js";
7
+ } from "./chunk-RJIL6AHL.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-SRZOQNU6.js";
24
+ } from "./chunk-A3W36FF5.js";
25
25
 
26
26
  // src/runtime-env-loader.ts
27
27
  import { readFileSync } from "fs";
@@ -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-CIIXI7DT.js";
6
+ } from "./chunk-RJIL6AHL.js";
7
7
  import {
8
8
  isVersionBelow
9
- } from "./chunk-SRZOQNU6.js";
9
+ } from "./chunk-A3W36FF5.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.1619";
243
+ var ENGINE_PACKAGE_VERSION = "0.1.1621";
244
244
  var INITIALIZE_METHOD = "initialize";
245
245
  var INITIALIZED_NOTIFICATION = "initialized";
246
246
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -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-VPYWQZU5.js";
6
+ } from "./chunk-KT4MUSIR.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-SRZOQNU6.js";
18
+ } from "./chunk-A3W36FF5.js";
19
19
 
20
20
  // src/managers/codex-asp/notification-dispatch.ts
21
21
  var TURN_STARTED_METHOD = "turn/started";
@@ -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-SRZOQNU6.js";
6
+ } from "./chunk-A3W36FF5.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-SRZOQNU6.js";
8
+ } from "./chunk-A3W36FF5.js";
9
9
 
10
10
  // src/services/published-pull-request-urls.ts
11
11
  function publishedPullRequestUrls(result) {
@@ -12,15 +12,15 @@ import {
12
12
  resolveDiffBase,
13
13
  runGitCommand,
14
14
  setAgentCredentialSnapshot
15
- } from "./chunk-DFT2HMHS.js";
15
+ } from "./chunk-FC5YLKZF.js";
16
16
  import {
17
17
  AppServerProcess,
18
18
  buildCodexAgentEnv
19
- } from "./chunk-VPYWQZU5.js";
19
+ } from "./chunk-KT4MUSIR.js";
20
20
  import {
21
21
  SUBPROCESS_MAX_BUFFER,
22
22
  execFileAsync
23
- } from "./chunk-CIIXI7DT.js";
23
+ } from "./chunk-RJIL6AHL.js";
24
24
  import {
25
25
  isRecord
26
26
  } from "./chunk-UZSNFLDQ.js";
@@ -61,7 +61,7 @@ import {
61
61
  shrunkImageSize,
62
62
  splitMothershipInstructions,
63
63
  withTimeout
64
- } from "./chunk-SRZOQNU6.js";
64
+ } from "./chunk-A3W36FF5.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-2F45QGAE.js");
464
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-2FYDPEV7.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-2F45QGAE.js");
486
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-2FYDPEV7.js");
487
487
  await restartCodexAspHostIfRunning2();
488
488
  }
489
489
  setAgentCredentialSnapshot("codex", data);
@@ -5,7 +5,7 @@ import {
5
5
  ENGINE_ENV,
6
6
  monolithRequest,
7
7
  runGitCommand
8
- } from "./chunk-DFT2HMHS.js";
8
+ } from "./chunk-FC5YLKZF.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
  withE2BRetry
21
- } from "./chunk-SRZOQNU6.js";
21
+ } from "./chunk-A3W36FF5.js";
22
22
 
23
23
  // src/services/command-protection-service.ts
24
24
  import { readFile, stat } from "fs/promises";
@@ -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-Q4AUOMAU.js";
7
- import "./chunk-DFT2HMHS.js";
8
- import "./chunk-CIIXI7DT.js";
6
+ } from "./chunk-YW2FFPDO.js";
7
+ import "./chunk-FC5YLKZF.js";
8
+ import "./chunk-RJIL6AHL.js";
9
9
  import {
10
10
  isRecord
11
11
  } from "./chunk-UZSNFLDQ.js";
12
- import "./chunk-SRZOQNU6.js";
12
+ import "./chunk-A3W36FF5.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-MQHTZJCM.js";
17
+ } from "./chunk-MKL57GDX.js";
18
18
  import {
19
19
  AppServerProcess,
20
20
  buildCodexAgentEnv
21
- } from "./chunk-VPYWQZU5.js";
22
- import "./chunk-CIIXI7DT.js";
21
+ } from "./chunk-KT4MUSIR.js";
22
+ import "./chunk-RJIL6AHL.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-SRZOQNU6.js";
32
+ } from "./chunk-A3W36FF5.js";
33
33
  import "./chunk-VEQXQN22.js";
34
34
 
35
35
  // src/headless-agent.ts
package/dist/src/index.js CHANGED
@@ -91,7 +91,7 @@ import {
91
91
  evaluateCommandProtection,
92
92
  extractToolCommand,
93
93
  reportCommandProtectionBlock
94
- } from "./chunk-Q4AUOMAU.js";
94
+ } from "./chunk-YW2FFPDO.js";
95
95
  import {
96
96
  ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
97
97
  AGENT_MESSAGE_DELTA_METHOD,
@@ -129,10 +129,10 @@ import {
129
129
  spawnMuseMsp,
130
130
  startMuseSession,
131
131
  uuidV7
132
- } from "./chunk-MQHTZJCM.js";
132
+ } from "./chunk-MKL57GDX.js";
133
133
  import {
134
134
  publishedPullRequestUrls
135
- } from "./chunk-O3O5ZQR7.js";
135
+ } from "./chunk-XSZGXNMM.js";
136
136
  import {
137
137
  ACCOUNT_RATE_LIMITS_READ_METHOD,
138
138
  AsyncLock,
@@ -212,7 +212,7 @@ import {
212
212
  transcriptSecrets,
213
213
  upsertCredentialFileLines,
214
214
  writeSecureCredentialFile
215
- } from "./chunk-JHJCT5XG.js";
215
+ } from "./chunk-YT6WV6IO.js";
216
216
  import {
217
217
  ENGINE_ENV,
218
218
  UNQUOTED_PATHS_CONFIG,
@@ -223,16 +223,16 @@ import {
223
223
  resolveDiffBase,
224
224
  setAgentCredentialSnapshot,
225
225
  setLinearSessionId
226
- } from "./chunk-DFT2HMHS.js";
226
+ } from "./chunk-FC5YLKZF.js";
227
227
  import {
228
228
  buildCodexAgentEnv,
229
229
  getCodexModelProvider
230
- } from "./chunk-VPYWQZU5.js";
230
+ } from "./chunk-KT4MUSIR.js";
231
231
  import {
232
232
  SUBPROCESS_MAX_BUFFER,
233
233
  execAsync,
234
234
  execFileAsync
235
- } from "./chunk-CIIXI7DT.js";
235
+ } from "./chunk-RJIL6AHL.js";
236
236
  import {
237
237
  isRecord as isRecord2
238
238
  } from "./chunk-UZSNFLDQ.js";
@@ -529,7 +529,7 @@ import {
529
529
  workspaceTokenRequestSchema,
530
530
  workspaceTokenResponseSchema,
531
531
  wrapInTag
532
- } from "./chunk-SRZOQNU6.js";
532
+ } from "./chunk-A3W36FF5.js";
533
533
  import {
534
534
  __commonJS,
535
535
  __export,
@@ -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-O3O5ZQR7.js";
6
+ } from "./chunk-XSZGXNMM.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-UZSNFLDQ.js";
10
10
  import {
11
11
  shouldRefreshPullRequests
12
- } from "./chunk-SRZOQNU6.js";
12
+ } from "./chunk-A3W36FF5.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-SRZOQNU6.js";
14
+ } from "./chunk-A3W36FF5.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.1619",
3
+ "version": "0.1.1621",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",