replicas-engine 0.1.637 → 0.1.638
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.
|
@@ -243,6 +243,7 @@ var headlessAgentOutputFileSchema = z.object({
|
|
|
243
243
|
path: z.string().min(1),
|
|
244
244
|
uploadUrl: z.url(),
|
|
245
245
|
contentType: z.string().min(1),
|
|
246
|
+
minChars: z.number().int().positive().optional(),
|
|
246
247
|
maxChars: z.number().int().positive().optional()
|
|
247
248
|
});
|
|
248
249
|
var headlessAgentRequestSchema = z.discriminatedUnion("mode", [
|
|
@@ -5873,7 +5874,7 @@ var DEFAULT_CODEX_ARGS = [
|
|
|
5873
5874
|
var MIN_CODEX_CLI_VERSION = "0.144.6";
|
|
5874
5875
|
var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
|
|
5875
5876
|
var codexCliVersionEnsured = null;
|
|
5876
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
5877
|
+
var ENGINE_PACKAGE_VERSION = "0.1.638";
|
|
5877
5878
|
var INITIALIZE_METHOD = "initialize";
|
|
5878
5879
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
5879
5880
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
isUnsafeMemoryOutput,
|
|
8
8
|
putPresignedFile,
|
|
9
9
|
recoverCompletedTurn
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Z4OLZBZN.js";
|
|
11
11
|
|
|
12
12
|
// src/headless-agent.ts
|
|
13
13
|
import { createHash } from "crypto";
|
|
@@ -59,7 +59,7 @@ async function publishFilesystemOutputs(request) {
|
|
|
59
59
|
for (const output of request.outputFiles) {
|
|
60
60
|
const filePath = resolveFile(request.workingDirectory, output.path);
|
|
61
61
|
const content = (await readFile(filePath, "utf8")).trim();
|
|
62
|
-
if (isUnsafeMemoryOutput(content, request.sensitiveValues, output.maxChars)) {
|
|
62
|
+
if (output.minChars !== void 0 && content.length < output.minChars || isUnsafeMemoryOutput(content, request.sensitiveValues, output.maxChars)) {
|
|
63
63
|
throw new Error(`Headless agent output failed validation: ${output.path}`);
|
|
64
64
|
}
|
|
65
65
|
await writeFile(filePath, content, { mode: 384 });
|
|
@@ -182,18 +182,14 @@ async function runCodex(request) {
|
|
|
182
182
|
approvalPolicy: "never",
|
|
183
183
|
approvalsReviewer: "user",
|
|
184
184
|
sandbox: request.mode === "filesystem" ? "workspace-write" : "read-only",
|
|
185
|
-
ephemeral: true
|
|
186
|
-
environments: [],
|
|
187
|
-
dynamicTools: [],
|
|
188
|
-
selectedCapabilityRoots: []
|
|
185
|
+
ephemeral: true
|
|
189
186
|
});
|
|
190
187
|
const { turn, message } = await runCodexTurn(client, {
|
|
191
188
|
threadId: thread.thread.id,
|
|
192
189
|
input: [{ type: "text", text: request.prompt, text_elements: [] }],
|
|
193
190
|
...request.mode === "structured" ? { outputSchema: request.outputSchema } : {},
|
|
194
191
|
approvalPolicy: "never",
|
|
195
|
-
approvalsReviewer: "user"
|
|
196
|
-
environments: []
|
|
192
|
+
approvalsReviewer: "user"
|
|
197
193
|
}, request.timeoutSeconds * 1e3);
|
|
198
194
|
if (turn.status === "failed") throw new Error(turn.error?.message ?? "Codex ASP turn failed");
|
|
199
195
|
if (!message) throw new Error("Codex ASP returned no final message");
|
package/dist/src/index.js
CHANGED