poe-code 3.0.242 → 3.0.243
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/cli/commands/configure.js +1 -1
- package/dist/cli/commands/configure.js.map +1 -1
- package/dist/cli/commands/experiment.js +15 -4
- package/dist/cli/commands/experiment.js.map +1 -1
- package/dist/cli/commands/harness.js +23 -16
- package/dist/cli/commands/harness.js.map +1 -1
- package/dist/cli/commands/pipeline.js +13 -2
- package/dist/cli/commands/pipeline.js.map +1 -1
- package/dist/cli/commands/ralph.js +4 -1
- package/dist/cli/commands/ralph.js.map +1 -1
- package/dist/cli/commands/runtime/shared.js +15 -4
- package/dist/cli/commands/runtime/shared.js.map +1 -1
- package/dist/codegen/agent-spawn-py-types.js +4 -1
- package/dist/codegen/agent-spawn-py-types.js.map +1 -1
- package/dist/index.js +73 -31
- package/dist/index.js.map +3 -3
- package/dist/metafile.json +1 -1
- package/dist/services/media-download.js +5 -2
- package/dist/services/media-download.js.map +1 -1
- package/dist/services/model-strategy.js +13 -2
- package/dist/services/model-strategy.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -85710,7 +85710,7 @@ async function replaceBasePathAtomically(fs28, filePath, createTemporaryPath) {
|
|
|
85710
85710
|
if (isAlreadyExistsError14(error3) && !temporaryCreated) {
|
|
85711
85711
|
continue;
|
|
85712
85712
|
}
|
|
85713
|
-
if (temporaryCreated) {
|
|
85713
|
+
if (temporaryCreated || !isAlreadyExistsError14(error3)) {
|
|
85714
85714
|
await fs28.unlink(temporaryPath).catch((cleanupError) => {
|
|
85715
85715
|
if (!isNotFoundError10(cleanupError)) {
|
|
85716
85716
|
throw cleanupError;
|
|
@@ -88226,8 +88226,8 @@ async function downloadToFile(options) {
|
|
|
88226
88226
|
temporaryCreated = true;
|
|
88227
88227
|
await options.fs.rename(temporaryPath, options.outputPath);
|
|
88228
88228
|
temporaryCreated = false;
|
|
88229
|
-
} catch {
|
|
88230
|
-
if (temporaryCreated) {
|
|
88229
|
+
} catch (error3) {
|
|
88230
|
+
if (temporaryCreated || !isAlreadyExists8(error3)) {
|
|
88231
88231
|
await options.fs.unlink(temporaryPath).catch(() => void 0);
|
|
88232
88232
|
}
|
|
88233
88233
|
throw new MediaDownloadError("Failed to write media", {
|
|
@@ -88237,6 +88237,9 @@ async function downloadToFile(options) {
|
|
|
88237
88237
|
});
|
|
88238
88238
|
}
|
|
88239
88239
|
}
|
|
88240
|
+
function isAlreadyExists8(error3) {
|
|
88241
|
+
return error3 instanceof Error && "code" in error3 && error3.code === "EEXIST";
|
|
88242
|
+
}
|
|
88240
88243
|
var MediaDownloadError;
|
|
88241
88244
|
var init_media_download = __esm({
|
|
88242
88245
|
"src/services/media-download.ts"() {
|
|
@@ -91114,7 +91117,14 @@ async function pathExists12(fs28, targetPath) {
|
|
|
91114
91117
|
}
|
|
91115
91118
|
async function writePipelineTextFile(fs28, filePath, content, options) {
|
|
91116
91119
|
if (options.exclusive) {
|
|
91117
|
-
|
|
91120
|
+
try {
|
|
91121
|
+
await fs28.writeFile(filePath, content, { encoding: "utf8", flag: "wx" });
|
|
91122
|
+
} catch (error3) {
|
|
91123
|
+
if (!isAlreadyExists9(error3)) {
|
|
91124
|
+
await fs28.unlink(filePath).catch(() => void 0);
|
|
91125
|
+
}
|
|
91126
|
+
throw error3;
|
|
91127
|
+
}
|
|
91118
91128
|
return;
|
|
91119
91129
|
}
|
|
91120
91130
|
const temporaryPath = `${filePath}.${process.pid}.${randomUUID38()}.tmp`;
|
|
@@ -91124,12 +91134,15 @@ async function writePipelineTextFile(fs28, filePath, content, options) {
|
|
|
91124
91134
|
temporaryCreated = true;
|
|
91125
91135
|
await fs28.rename(temporaryPath, filePath);
|
|
91126
91136
|
} catch (error3) {
|
|
91127
|
-
if (temporaryCreated) {
|
|
91137
|
+
if (temporaryCreated || !isAlreadyExists9(error3)) {
|
|
91128
91138
|
await fs28.unlink(temporaryPath).catch(() => void 0);
|
|
91129
91139
|
}
|
|
91130
91140
|
throw error3;
|
|
91131
91141
|
}
|
|
91132
91142
|
}
|
|
91143
|
+
function isAlreadyExists9(error3) {
|
|
91144
|
+
return error3 instanceof Error && "code" in error3 && error3.code === "EEXIST";
|
|
91145
|
+
}
|
|
91133
91146
|
function registerPipelineCommand(program, container) {
|
|
91134
91147
|
const pipeline = program.command("pipeline").description("Run a fixed-step task pipeline plan.").addHelpCommand(false);
|
|
91135
91148
|
pipeline.command("run").description(
|
|
@@ -91962,12 +91975,15 @@ async function writeTextFileAtomically(fs28, filePath, content, options) {
|
|
|
91962
91975
|
temporaryCreated = true;
|
|
91963
91976
|
await fs28.rename(temporaryPath, filePath);
|
|
91964
91977
|
} catch (error3) {
|
|
91965
|
-
if (temporaryCreated) {
|
|
91978
|
+
if (temporaryCreated || !isAlreadyExists10(error3)) {
|
|
91966
91979
|
await fs28.unlink(temporaryPath).catch(() => void 0);
|
|
91967
91980
|
}
|
|
91968
91981
|
throw error3;
|
|
91969
91982
|
}
|
|
91970
91983
|
}
|
|
91984
|
+
function isAlreadyExists10(error3) {
|
|
91985
|
+
return error3 instanceof Error && "code" in error3 && error3.code === "EEXIST";
|
|
91986
|
+
}
|
|
91971
91987
|
async function resolveDocPath2(options) {
|
|
91972
91988
|
if (options.providedDoc && options.providedDoc.trim().length > 0) {
|
|
91973
91989
|
return options.providedDoc.trim();
|
|
@@ -93161,10 +93177,17 @@ function registerExperimentCommand(program, container) {
|
|
|
93161
93177
|
if (flags.dryRun) {
|
|
93162
93178
|
resources.logger.dryRun(`Would create: ${runYamlDisplayPath}`);
|
|
93163
93179
|
} else {
|
|
93164
|
-
|
|
93165
|
-
|
|
93166
|
-
|
|
93167
|
-
|
|
93180
|
+
try {
|
|
93181
|
+
await container.fs.writeFile(runYamlPath, templates.runYaml, {
|
|
93182
|
+
encoding: "utf8",
|
|
93183
|
+
flag: "wx"
|
|
93184
|
+
});
|
|
93185
|
+
} catch (error3) {
|
|
93186
|
+
if (!isAlreadyExists11(error3)) {
|
|
93187
|
+
await container.fs.unlink(runYamlPath).catch(() => void 0);
|
|
93188
|
+
}
|
|
93189
|
+
throw error3;
|
|
93190
|
+
}
|
|
93168
93191
|
createdRunYaml = true;
|
|
93169
93192
|
resources.logger.info(`Create: ${runYamlDisplayPath}`);
|
|
93170
93193
|
}
|
|
@@ -93208,6 +93231,9 @@ function registerExperimentCommand(program, container) {
|
|
|
93208
93231
|
}
|
|
93209
93232
|
});
|
|
93210
93233
|
}
|
|
93234
|
+
function isAlreadyExists11(error3) {
|
|
93235
|
+
return error3 instanceof Error && "code" in error3 && error3.code === "EEXIST";
|
|
93236
|
+
}
|
|
93211
93237
|
var DEFAULT_EXPERIMENT_AGENT, DEFAULT_EXPERIMENT_SCOPE, experimentTemplatesCache;
|
|
93212
93238
|
var init_experiment3 = __esm({
|
|
93213
93239
|
async "src/cli/commands/experiment.ts"() {
|
|
@@ -97183,10 +97209,17 @@ async function writeDefaultDockerfileIfNeeded(input) {
|
|
|
97183
97209
|
return false;
|
|
97184
97210
|
}
|
|
97185
97211
|
await input.container.fs.mkdir(path156.dirname(dockerfilePath), { recursive: true });
|
|
97186
|
-
|
|
97187
|
-
|
|
97188
|
-
|
|
97189
|
-
|
|
97212
|
+
try {
|
|
97213
|
+
await input.container.fs.writeFile(dockerfilePath, defaultDockerfile, {
|
|
97214
|
+
encoding: "utf8",
|
|
97215
|
+
flag: "wx"
|
|
97216
|
+
});
|
|
97217
|
+
} catch (error3) {
|
|
97218
|
+
if (!isAlreadyExists12(error3)) {
|
|
97219
|
+
await input.container.fs.unlink(dockerfilePath).catch(() => void 0);
|
|
97220
|
+
}
|
|
97221
|
+
throw error3;
|
|
97222
|
+
}
|
|
97190
97223
|
return true;
|
|
97191
97224
|
}
|
|
97192
97225
|
function parseRuntimeType2(value) {
|
|
@@ -97195,6 +97228,9 @@ function parseRuntimeType2(value) {
|
|
|
97195
97228
|
}
|
|
97196
97229
|
throw new Error(`Invalid runtime type "${value}". Expected host, docker, or e2b.`);
|
|
97197
97230
|
}
|
|
97231
|
+
function isAlreadyExists12(error3) {
|
|
97232
|
+
return error3 instanceof Error && "code" in error3 && error3.code === "EEXIST";
|
|
97233
|
+
}
|
|
97198
97234
|
var runtimeTypes, defaultRuntimeType, defaultDockerfile;
|
|
97199
97235
|
var init_shared2 = __esm({
|
|
97200
97236
|
"src/cli/commands/runtime/shared.ts"() {
|
|
@@ -126013,24 +126049,14 @@ async function executeHarnessNew(program, container, kind, basename10, options)
|
|
|
126013
126049
|
readFile56(template2.ajsPath, "utf8")
|
|
126014
126050
|
]);
|
|
126015
126051
|
await container.fs.mkdir(resolvedDir, { recursive: true });
|
|
126052
|
+
const createdPaths = [];
|
|
126016
126053
|
try {
|
|
126017
|
-
await
|
|
126018
|
-
|
|
126019
|
-
|
|
126020
|
-
|
|
126054
|
+
await writeHarnessScaffoldFile(container.fs, mdPath, mdSource);
|
|
126055
|
+
createdPaths.push(mdPath);
|
|
126056
|
+
await writeHarnessScaffoldFile(container.fs, ajsPath, ajsSource);
|
|
126057
|
+
createdPaths.push(ajsPath);
|
|
126021
126058
|
} catch (error3) {
|
|
126022
|
-
await
|
|
126023
|
-
container.fs.unlink(mdPath).catch((cleanupError) => {
|
|
126024
|
-
if (!hasErrorCode7(cleanupError, "ENOENT")) {
|
|
126025
|
-
throw cleanupError;
|
|
126026
|
-
}
|
|
126027
|
-
}),
|
|
126028
|
-
container.fs.unlink(ajsPath).catch((cleanupError) => {
|
|
126029
|
-
if (!hasErrorCode7(cleanupError, "ENOENT")) {
|
|
126030
|
-
throw cleanupError;
|
|
126031
|
-
}
|
|
126032
|
-
})
|
|
126033
|
-
]).catch(() => void 0);
|
|
126059
|
+
await cleanupHarnessScaffoldFiles(container.fs, createdPaths);
|
|
126034
126060
|
throw error3;
|
|
126035
126061
|
}
|
|
126036
126062
|
resources.context.complete({
|
|
@@ -126039,6 +126065,22 @@ async function executeHarnessNew(program, container, kind, basename10, options)
|
|
|
126039
126065
|
});
|
|
126040
126066
|
resources.context.finalize();
|
|
126041
126067
|
}
|
|
126068
|
+
async function writeHarnessScaffoldFile(fs28, filePath, source) {
|
|
126069
|
+
try {
|
|
126070
|
+
await fs28.writeFile(filePath, source, { encoding: "utf8", flag: "wx" });
|
|
126071
|
+
} catch (error3) {
|
|
126072
|
+
if (!hasErrorCode7(error3, "EEXIST")) {
|
|
126073
|
+
await tryUnlinkHarnessScaffoldFile(fs28, filePath);
|
|
126074
|
+
}
|
|
126075
|
+
throw error3;
|
|
126076
|
+
}
|
|
126077
|
+
}
|
|
126078
|
+
async function cleanupHarnessScaffoldFiles(fs28, filePaths) {
|
|
126079
|
+
await Promise.all(filePaths.map((filePath) => tryUnlinkHarnessScaffoldFile(fs28, filePath)));
|
|
126080
|
+
}
|
|
126081
|
+
async function tryUnlinkHarnessScaffoldFile(fs28, filePath) {
|
|
126082
|
+
await fs28.unlink(filePath).catch(() => void 0);
|
|
126083
|
+
}
|
|
126042
126084
|
async function executeHarnessList(program, container) {
|
|
126043
126085
|
const flags = resolveCommandFlags(program);
|
|
126044
126086
|
const resources = createExecutionResources(container, flags, "harness:list");
|
|
@@ -127088,7 +127130,7 @@ var init_package2 = __esm({
|
|
|
127088
127130
|
"package.json"() {
|
|
127089
127131
|
package_default2 = {
|
|
127090
127132
|
name: "poe-code",
|
|
127091
|
-
version: "3.0.
|
|
127133
|
+
version: "3.0.243",
|
|
127092
127134
|
description: "CLI tool to configure Poe API for developer workflows.",
|
|
127093
127135
|
type: "module",
|
|
127094
127136
|
main: "./dist/index.js",
|