replicas-engine 0.1.242 → 0.1.244
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.
- package/dist/src/index.js +24 -29
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -183,7 +183,6 @@ function buildCodexTokenUsageContextUsagePayload(usage) {
|
|
|
183
183
|
rawMaxTokens: maxTokens,
|
|
184
184
|
percentage: percentage(totalTokens, maxTokens),
|
|
185
185
|
compactsAutomatically: true,
|
|
186
|
-
...autoCompactThresholdField(usage.autoCompactThreshold),
|
|
187
186
|
categories: compactCategories([
|
|
188
187
|
{
|
|
189
188
|
name: "Input context",
|
|
@@ -290,7 +289,7 @@ var WORKSPACE_SIZES = ["small", "large"];
|
|
|
290
289
|
var INVALID_WORKSPACE_SIZE_ERROR = `Invalid size: must be one of ${WORKSPACE_SIZES.join(", ")}`;
|
|
291
290
|
|
|
292
291
|
// ../shared/src/e2b.ts
|
|
293
|
-
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-05-30-
|
|
292
|
+
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-05-30-v5";
|
|
294
293
|
|
|
295
294
|
// ../shared/src/runtime-env.ts
|
|
296
295
|
function parsePosixEnvFile(content) {
|
|
@@ -1923,7 +1922,13 @@ function coerceBackgroundTaskPayload(payload) {
|
|
|
1923
1922
|
const patch = isRecord(payload.patch) ? {
|
|
1924
1923
|
status: optionalString(payload.patch.status),
|
|
1925
1924
|
description: optionalString(payload.patch.description),
|
|
1926
|
-
error: optionalString(payload.patch.error)
|
|
1925
|
+
error: optionalString(payload.patch.error),
|
|
1926
|
+
isBackgrounded: optionalBoolean(payload.patch.is_backgrounded)
|
|
1927
|
+
} : void 0;
|
|
1928
|
+
const usage = isRecord(payload.usage) ? {
|
|
1929
|
+
totalTokens: optionalNumber(payload.usage.total_tokens),
|
|
1930
|
+
toolUses: optionalNumber(payload.usage.tool_uses),
|
|
1931
|
+
durationMs: optionalNumber(payload.usage.duration_ms)
|
|
1927
1932
|
} : void 0;
|
|
1928
1933
|
return {
|
|
1929
1934
|
subtype,
|
|
@@ -1932,9 +1937,20 @@ function coerceBackgroundTaskPayload(payload) {
|
|
|
1932
1937
|
summary: optionalString(payload.summary),
|
|
1933
1938
|
outputFile: optionalString(payload.output_file),
|
|
1934
1939
|
status: optionalString(payload.status),
|
|
1940
|
+
taskType: optionalString(payload.task_type),
|
|
1941
|
+
workflowName: optionalString(payload.workflow_name),
|
|
1942
|
+
prompt: optionalString(payload.prompt),
|
|
1943
|
+
lastToolName: optionalString(payload.last_tool_name),
|
|
1944
|
+
usage,
|
|
1935
1945
|
patch
|
|
1936
1946
|
};
|
|
1937
1947
|
}
|
|
1948
|
+
function optionalNumber(value) {
|
|
1949
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
1950
|
+
}
|
|
1951
|
+
function optionalBoolean(value) {
|
|
1952
|
+
return typeof value === "boolean" ? value : void 0;
|
|
1953
|
+
}
|
|
1938
1954
|
function normalizeBackgroundTaskStatus(status) {
|
|
1939
1955
|
if (status === "completed" || status === "failed" || status === "stopped") {
|
|
1940
1956
|
return status;
|
|
@@ -6086,7 +6102,7 @@ var AspClient = class {
|
|
|
6086
6102
|
// src/managers/codex-asp/app-server-process.ts
|
|
6087
6103
|
var DEFAULT_CODEX_BINARY = "codex";
|
|
6088
6104
|
var DEFAULT_CODEX_ARGS = ["app-server", "--listen", "stdio://"];
|
|
6089
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
6105
|
+
var ENGINE_PACKAGE_VERSION = "0.1.244";
|
|
6090
6106
|
var INITIALIZE_METHOD = "initialize";
|
|
6091
6107
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
6092
6108
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -6364,24 +6380,6 @@ var TURN_START_METHOD = "turn/start";
|
|
|
6364
6380
|
var TURN_INTERRUPT_METHOD = "turn/interrupt";
|
|
6365
6381
|
var ACCOUNT_RATE_LIMITS_READ_METHOD = "account/rateLimits/read";
|
|
6366
6382
|
var MAX_CODEX_ASP_TRANSCRIPT_OUTPUT_CHARS = DEFAULT_HOOK_OUTPUT_PREVIEW_CHARS;
|
|
6367
|
-
var CODEX_ASP_AUTO_COMPACT_RATIO = 0.85;
|
|
6368
|
-
var CODEX_ASP_MODEL_CONTEXT_WINDOWS = {
|
|
6369
|
-
[DEFAULT_MODEL]: 258400
|
|
6370
|
-
};
|
|
6371
|
-
function codexAspAutoCompactTokenLimitForModel(model) {
|
|
6372
|
-
const contextWindow = CODEX_ASP_MODEL_CONTEXT_WINDOWS[model ?? DEFAULT_MODEL];
|
|
6373
|
-
return contextWindow === void 0 ? void 0 : Math.floor(contextWindow * CODEX_ASP_AUTO_COMPACT_RATIO);
|
|
6374
|
-
}
|
|
6375
|
-
function codexAspConfigForModel(model) {
|
|
6376
|
-
const tokenLimit = codexAspAutoCompactTokenLimitForModel(model);
|
|
6377
|
-
return {
|
|
6378
|
-
web_search: "live",
|
|
6379
|
-
...tokenLimit !== void 0 ? {
|
|
6380
|
-
model_auto_compact_token_limit: tokenLimit,
|
|
6381
|
-
model_auto_compact_token_limit_scope: "total"
|
|
6382
|
-
} : {}
|
|
6383
|
-
};
|
|
6384
|
-
}
|
|
6385
6383
|
function toReasoningEffort(thinkingLevel) {
|
|
6386
6384
|
return codexReasoningEffortForThinkingLevel(thinkingLevel);
|
|
6387
6385
|
}
|
|
@@ -6754,29 +6752,27 @@ function mergeCodexAspTranscripts(primary, supplemental) {
|
|
|
6754
6752
|
}
|
|
6755
6753
|
async function buildThreadStartParams(workingDirectory, request, developerInstructions) {
|
|
6756
6754
|
const additionalDirectories = await getAgentAdditionalDirectories();
|
|
6757
|
-
const model = request.model ?? DEFAULT_MODEL;
|
|
6758
6755
|
return {
|
|
6759
|
-
model,
|
|
6756
|
+
model: request.model ?? DEFAULT_MODEL,
|
|
6760
6757
|
cwd: workingDirectory,
|
|
6761
6758
|
runtimeWorkspaceRoots: additionalDirectories,
|
|
6762
6759
|
sandbox: "danger-full-access",
|
|
6763
6760
|
developerInstructions: developerInstructions ?? null,
|
|
6764
|
-
config:
|
|
6761
|
+
config: { web_search: "live" },
|
|
6765
6762
|
experimentalRawEvents: false,
|
|
6766
6763
|
persistExtendedHistory: false
|
|
6767
6764
|
};
|
|
6768
6765
|
}
|
|
6769
6766
|
async function buildThreadResumeParams(workingDirectory, threadId, request, developerInstructions) {
|
|
6770
6767
|
const additionalDirectories = await getAgentAdditionalDirectories();
|
|
6771
|
-
const model = request.model ?? DEFAULT_MODEL;
|
|
6772
6768
|
return {
|
|
6773
6769
|
threadId,
|
|
6774
|
-
model,
|
|
6770
|
+
model: request.model ?? DEFAULT_MODEL,
|
|
6775
6771
|
cwd: workingDirectory,
|
|
6776
6772
|
runtimeWorkspaceRoots: additionalDirectories,
|
|
6777
6773
|
sandbox: "danger-full-access",
|
|
6778
6774
|
developerInstructions: developerInstructions ?? null,
|
|
6779
|
-
config:
|
|
6775
|
+
config: { web_search: "live" },
|
|
6780
6776
|
excludeTurns: false,
|
|
6781
6777
|
persistExtendedHistory: false
|
|
6782
6778
|
};
|
|
@@ -7599,7 +7595,6 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
7599
7595
|
const payload = buildCodexTokenUsageContextUsagePayload({
|
|
7600
7596
|
model,
|
|
7601
7597
|
modelContextWindow: tokenUsage.modelContextWindow,
|
|
7602
|
-
autoCompactThreshold: codexAspAutoCompactTokenLimitForModel(model),
|
|
7603
7598
|
last: {
|
|
7604
7599
|
inputTokens: tokenUsage.last.inputTokens,
|
|
7605
7600
|
outputTokens: tokenUsage.last.outputTokens,
|