poe-code 3.0.175 → 3.0.176
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/README.md +6 -3
- package/dist/cli/commands/spawn.js +25 -3
- package/dist/cli/commands/spawn.js.map +1 -1
- package/dist/index.js +185 -157
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -737,11 +737,11 @@ var init_parse = __esm({
|
|
|
737
737
|
function mergeLayers(layers) {
|
|
738
738
|
return mergeObjectLayers(layers, []);
|
|
739
739
|
}
|
|
740
|
-
function mergeObjectLayers(layers,
|
|
740
|
+
function mergeObjectLayers(layers, path55) {
|
|
741
741
|
const data = {};
|
|
742
742
|
const sources = {};
|
|
743
743
|
for (const key of collectKeys(layers)) {
|
|
744
|
-
const resolved = resolveKey(layers, key,
|
|
744
|
+
const resolved = resolveKey(layers, key, path55);
|
|
745
745
|
if (resolved === void 0) {
|
|
746
746
|
continue;
|
|
747
747
|
}
|
|
@@ -759,7 +759,7 @@ function collectKeys(layers) {
|
|
|
759
759
|
}
|
|
760
760
|
return [...keys];
|
|
761
761
|
}
|
|
762
|
-
function resolveKey(layers, key,
|
|
762
|
+
function resolveKey(layers, key, path55) {
|
|
763
763
|
let winningSource;
|
|
764
764
|
let winningValue;
|
|
765
765
|
const objectLayers = [];
|
|
@@ -789,9 +789,9 @@ function resolveKey(layers, key, path54) {
|
|
|
789
789
|
if (winningSource === void 0) {
|
|
790
790
|
return void 0;
|
|
791
791
|
}
|
|
792
|
-
const fullPath = buildPath(
|
|
792
|
+
const fullPath = buildPath(path55, key);
|
|
793
793
|
if (isPlainObject(winningValue)) {
|
|
794
|
-
const merged = mergeObjectLayers(objectLayers, [...
|
|
794
|
+
const merged = mergeObjectLayers(objectLayers, [...path55, key]);
|
|
795
795
|
return {
|
|
796
796
|
value: merged.data,
|
|
797
797
|
sources: {
|
|
@@ -816,8 +816,8 @@ function isWinningCandidate(key, value) {
|
|
|
816
816
|
}
|
|
817
817
|
return true;
|
|
818
818
|
}
|
|
819
|
-
function buildPath(
|
|
820
|
-
return [...
|
|
819
|
+
function buildPath(path55, key) {
|
|
820
|
+
return [...path55, key].join(".");
|
|
821
821
|
}
|
|
822
822
|
function isPlainObject(value) {
|
|
823
823
|
if (value === null || Array.isArray(value) || typeof value !== "object") {
|
|
@@ -1495,16 +1495,16 @@ function getConfigFormat(pathOrFormat) {
|
|
|
1495
1495
|
}
|
|
1496
1496
|
return formatRegistry[formatName];
|
|
1497
1497
|
}
|
|
1498
|
-
function detectFormat2(
|
|
1499
|
-
const ext = getExtension(
|
|
1498
|
+
function detectFormat2(path55) {
|
|
1499
|
+
const ext = getExtension(path55);
|
|
1500
1500
|
return extensionMap[ext];
|
|
1501
1501
|
}
|
|
1502
|
-
function getExtension(
|
|
1503
|
-
const lastDot =
|
|
1502
|
+
function getExtension(path55) {
|
|
1503
|
+
const lastDot = path55.lastIndexOf(".");
|
|
1504
1504
|
if (lastDot === -1) {
|
|
1505
1505
|
return "";
|
|
1506
1506
|
}
|
|
1507
|
-
return
|
|
1507
|
+
return path55.slice(lastDot).toLowerCase();
|
|
1508
1508
|
}
|
|
1509
1509
|
var formatRegistry, extensionMap;
|
|
1510
1510
|
var init_formats = __esm({
|
|
@@ -2604,38 +2604,38 @@ import { createTwoFilesPatch } from "diff";
|
|
|
2604
2604
|
import chalk from "chalk";
|
|
2605
2605
|
function createDryRunFileSystem(base, recorder) {
|
|
2606
2606
|
const proxy = {
|
|
2607
|
-
async readFile(
|
|
2607
|
+
async readFile(path55, encoding) {
|
|
2608
2608
|
if (encoding) {
|
|
2609
|
-
return base.readFile(
|
|
2609
|
+
return base.readFile(path55, encoding);
|
|
2610
2610
|
}
|
|
2611
|
-
return base.readFile(
|
|
2611
|
+
return base.readFile(path55);
|
|
2612
2612
|
},
|
|
2613
|
-
async writeFile(
|
|
2614
|
-
const previousContent = await tryReadText(base,
|
|
2613
|
+
async writeFile(path55, data, options) {
|
|
2614
|
+
const previousContent = await tryReadText(base, path55);
|
|
2615
2615
|
const nextContent = formatData(data, options?.encoding);
|
|
2616
2616
|
recorder.record({
|
|
2617
2617
|
type: "writeFile",
|
|
2618
|
-
path:
|
|
2618
|
+
path: path55,
|
|
2619
2619
|
nextContent,
|
|
2620
2620
|
previousContent
|
|
2621
2621
|
});
|
|
2622
2622
|
},
|
|
2623
|
-
async mkdir(
|
|
2624
|
-
recorder.record({ type: "mkdir", path:
|
|
2623
|
+
async mkdir(path55, options) {
|
|
2624
|
+
recorder.record({ type: "mkdir", path: path55, options });
|
|
2625
2625
|
},
|
|
2626
|
-
async stat(
|
|
2627
|
-
return base.stat(
|
|
2626
|
+
async stat(path55) {
|
|
2627
|
+
return base.stat(path55);
|
|
2628
2628
|
},
|
|
2629
|
-
async unlink(
|
|
2630
|
-
recorder.record({ type: "unlink", path:
|
|
2629
|
+
async unlink(path55) {
|
|
2630
|
+
recorder.record({ type: "unlink", path: path55 });
|
|
2631
2631
|
},
|
|
2632
|
-
async readdir(
|
|
2633
|
-
return base.readdir(
|
|
2632
|
+
async readdir(path55) {
|
|
2633
|
+
return base.readdir(path55);
|
|
2634
2634
|
}
|
|
2635
2635
|
};
|
|
2636
2636
|
if (typeof base.rm === "function") {
|
|
2637
|
-
proxy.rm = async (
|
|
2638
|
-
recorder.record({ type: "rm", path:
|
|
2637
|
+
proxy.rm = async (path55, options) => {
|
|
2638
|
+
recorder.record({ type: "rm", path: path55, options });
|
|
2639
2639
|
};
|
|
2640
2640
|
}
|
|
2641
2641
|
if (typeof base.copyFile === "function") {
|
|
@@ -2725,8 +2725,8 @@ function describeWriteChange(previous, next) {
|
|
|
2725
2725
|
}
|
|
2726
2726
|
return "update";
|
|
2727
2727
|
}
|
|
2728
|
-
function renderWriteCommand(
|
|
2729
|
-
const command = `cat > ${
|
|
2728
|
+
function renderWriteCommand(path55, change) {
|
|
2729
|
+
const command = `cat > ${path55}`;
|
|
2730
2730
|
if (change === "create") {
|
|
2731
2731
|
return renderOperationCommand(command, chalk.green, "# create");
|
|
2732
2732
|
}
|
|
@@ -2888,9 +2888,9 @@ function redactTomlLine(line) {
|
|
|
2888
2888
|
}
|
|
2889
2889
|
return line;
|
|
2890
2890
|
}
|
|
2891
|
-
async function tryReadText(base,
|
|
2891
|
+
async function tryReadText(base, path55) {
|
|
2892
2892
|
try {
|
|
2893
|
-
return await base.readFile(
|
|
2893
|
+
return await base.readFile(path55, "utf8");
|
|
2894
2894
|
} catch (error2) {
|
|
2895
2895
|
if (isNotFound(error2)) {
|
|
2896
2896
|
return null;
|
|
@@ -9560,8 +9560,8 @@ function resourceNotFound(resource) {
|
|
|
9560
9560
|
`Resource not found: ${resource}`
|
|
9561
9561
|
);
|
|
9562
9562
|
}
|
|
9563
|
-
function assertAbsolutePath(
|
|
9564
|
-
if (!isAbsolute(
|
|
9563
|
+
function assertAbsolutePath(path55) {
|
|
9564
|
+
if (!isAbsolute(path55)) {
|
|
9565
9565
|
throw invalidParams('"path" must be an absolute path');
|
|
9566
9566
|
}
|
|
9567
9567
|
}
|
|
@@ -10436,21 +10436,21 @@ async function* adaptClaude(lines) {
|
|
|
10436
10436
|
if (blockType !== "tool_result") continue;
|
|
10437
10437
|
const kind = toolKindsById.get(item.tool_use_id);
|
|
10438
10438
|
toolKindsById.delete(item.tool_use_id);
|
|
10439
|
-
let
|
|
10439
|
+
let path55;
|
|
10440
10440
|
if (typeof item.content === "string") {
|
|
10441
|
-
|
|
10441
|
+
path55 = item.content;
|
|
10442
10442
|
} else {
|
|
10443
10443
|
try {
|
|
10444
|
-
|
|
10444
|
+
path55 = JSON.stringify(item.content);
|
|
10445
10445
|
} catch {
|
|
10446
|
-
|
|
10446
|
+
path55 = String(item.content);
|
|
10447
10447
|
}
|
|
10448
10448
|
}
|
|
10449
10449
|
yield {
|
|
10450
10450
|
event: "tool_complete",
|
|
10451
10451
|
id: item.tool_use_id,
|
|
10452
10452
|
kind,
|
|
10453
|
-
path:
|
|
10453
|
+
path: path55
|
|
10454
10454
|
};
|
|
10455
10455
|
}
|
|
10456
10456
|
}
|
|
@@ -10573,10 +10573,10 @@ async function* adaptCodex(lines) {
|
|
|
10573
10573
|
const kindFromStart = toolKindById.get(item.id);
|
|
10574
10574
|
const kind = kindFromStart ?? (itemType === "command_execution" ? "exec" : itemType === "file_edit" ? "edit" : "other");
|
|
10575
10575
|
const titleFromEvent = isNonEmptyString(item.path) ? item.path : itemType === "mcp_tool_call" ? `${isNonEmptyString(item.server) ? item.server : "unknown"}.${isNonEmptyString(item.tool) ? item.tool : "unknown"}` : void 0;
|
|
10576
|
-
const
|
|
10576
|
+
const path55 = titleFromEvent ?? toolTitleById.get(item.id) ?? "";
|
|
10577
10577
|
toolTitleById.delete(item.id);
|
|
10578
10578
|
toolKindById.delete(item.id);
|
|
10579
|
-
yield { event: "tool_complete", id: item.id, kind, path:
|
|
10579
|
+
yield { event: "tool_complete", id: item.id, kind, path: path55 };
|
|
10580
10580
|
}
|
|
10581
10581
|
}
|
|
10582
10582
|
}
|
|
@@ -11255,7 +11255,7 @@ function updateSessionFromEvent(ctx, event, toolCallsById) {
|
|
|
11255
11255
|
}
|
|
11256
11256
|
const id = readString(event.id);
|
|
11257
11257
|
const kind = readString(event.kind);
|
|
11258
|
-
const
|
|
11258
|
+
const path55 = readString(event.path);
|
|
11259
11259
|
let toolCall = id ? toolCallsById.get(id) : void 0;
|
|
11260
11260
|
if (!toolCall) {
|
|
11261
11261
|
toolCall = {};
|
|
@@ -11270,8 +11270,8 @@ function updateSessionFromEvent(ctx, event, toolCallsById) {
|
|
|
11270
11270
|
if (kind) {
|
|
11271
11271
|
toolCall.kind = kind;
|
|
11272
11272
|
}
|
|
11273
|
-
if (
|
|
11274
|
-
toolCall.path =
|
|
11273
|
+
if (path55) {
|
|
11274
|
+
toolCall.path = path55;
|
|
11275
11275
|
}
|
|
11276
11276
|
}
|
|
11277
11277
|
var sessionCapture;
|
|
@@ -11765,14 +11765,14 @@ function parseDockerLocator(input) {
|
|
|
11765
11765
|
throw new Error(`Invalid docker workspace locator "${input}".`);
|
|
11766
11766
|
}
|
|
11767
11767
|
const container = input.slice(0, slashIndex);
|
|
11768
|
-
const
|
|
11769
|
-
if (container.length === 0 ||
|
|
11768
|
+
const path55 = input.slice(slashIndex);
|
|
11769
|
+
if (container.length === 0 || path55.length === 0) {
|
|
11770
11770
|
throw new Error(`Invalid docker workspace locator "${input}".`);
|
|
11771
11771
|
}
|
|
11772
11772
|
return {
|
|
11773
11773
|
scheme: "docker",
|
|
11774
11774
|
container,
|
|
11775
|
-
path:
|
|
11775
|
+
path: path55
|
|
11776
11776
|
};
|
|
11777
11777
|
}
|
|
11778
11778
|
function splitOnce(input, separator) {
|
|
@@ -13659,21 +13659,21 @@ function createSdkContainer(options) {
|
|
|
13659
13659
|
});
|
|
13660
13660
|
loggerFactory.setErrorLogger(errorLogger);
|
|
13661
13661
|
const asyncFs = {
|
|
13662
|
-
readFile: ((
|
|
13662
|
+
readFile: ((path55, encoding) => {
|
|
13663
13663
|
if (encoding) {
|
|
13664
|
-
return fs2.readFile(
|
|
13664
|
+
return fs2.readFile(path55, encoding);
|
|
13665
13665
|
}
|
|
13666
|
-
return fs2.readFile(
|
|
13666
|
+
return fs2.readFile(path55);
|
|
13667
13667
|
}),
|
|
13668
|
-
writeFile: (
|
|
13669
|
-
mkdir: (
|
|
13668
|
+
writeFile: (path55, data, opts) => fs2.writeFile(path55, data, opts),
|
|
13669
|
+
mkdir: (path55, opts) => fs2.mkdir(path55, opts).then(() => {
|
|
13670
13670
|
}),
|
|
13671
|
-
stat: (
|
|
13672
|
-
rm: (
|
|
13673
|
-
unlink: (
|
|
13674
|
-
readdir: (
|
|
13671
|
+
stat: (path55) => fs2.stat(path55),
|
|
13672
|
+
rm: (path55, opts) => fs2.rm(path55, opts),
|
|
13673
|
+
unlink: (path55) => fs2.unlink(path55),
|
|
13674
|
+
readdir: (path55) => fs2.readdir(path55),
|
|
13675
13675
|
copyFile: (src, dest) => fs2.copyFile(src, dest),
|
|
13676
|
-
chmod: (
|
|
13676
|
+
chmod: (path55, mode) => fs2.chmod(path55, mode)
|
|
13677
13677
|
};
|
|
13678
13678
|
const contextFactory = createCommandContextFactory({ fs: asyncFs });
|
|
13679
13679
|
const authFs = {
|
|
@@ -15016,12 +15016,12 @@ function hasErrorCode(error2, code) {
|
|
|
15016
15016
|
}
|
|
15017
15017
|
function createDefaultFs2() {
|
|
15018
15018
|
return {
|
|
15019
|
-
mkdir: async (
|
|
15020
|
-
await fsPromises3.mkdir(
|
|
15019
|
+
mkdir: async (path55, options) => {
|
|
15020
|
+
await fsPromises3.mkdir(path55, options);
|
|
15021
15021
|
},
|
|
15022
15022
|
rmdir: fsPromises3.rmdir,
|
|
15023
|
-
stat: async (
|
|
15024
|
-
const stat15 = await fsPromises3.stat(
|
|
15023
|
+
stat: async (path55) => {
|
|
15024
|
+
const stat15 = await fsPromises3.stat(path55);
|
|
15025
15025
|
return {
|
|
15026
15026
|
isFile: () => stat15.isFile(),
|
|
15027
15027
|
isDirectory: () => stat15.isDirectory(),
|
|
@@ -25785,11 +25785,11 @@ function formatSegment(segment, casing) {
|
|
|
25785
25785
|
const separator = casing === "snake" ? "_" : "-";
|
|
25786
25786
|
return splitWords(segment).join(separator);
|
|
25787
25787
|
}
|
|
25788
|
-
function toOptionFlag(
|
|
25789
|
-
return `--${
|
|
25788
|
+
function toOptionFlag(path55, casing) {
|
|
25789
|
+
return `--${path55.map((segment) => formatSegment(segment, casing)).join(".")}`;
|
|
25790
25790
|
}
|
|
25791
|
-
function toOptionAttribute(
|
|
25792
|
-
return
|
|
25791
|
+
function toOptionAttribute(path55, casing) {
|
|
25792
|
+
return path55.map((segment) => {
|
|
25793
25793
|
const formatted = formatSegment(segment, casing);
|
|
25794
25794
|
if (casing === "snake") {
|
|
25795
25795
|
return formatted;
|
|
@@ -25800,13 +25800,13 @@ function toOptionAttribute(path54, casing) {
|
|
|
25800
25800
|
).join("");
|
|
25801
25801
|
}).join(".");
|
|
25802
25802
|
}
|
|
25803
|
-
function toDisplayPath3(
|
|
25804
|
-
return
|
|
25803
|
+
function toDisplayPath3(path55) {
|
|
25804
|
+
return path55.join(".");
|
|
25805
25805
|
}
|
|
25806
|
-
function collectFields(schema, casing,
|
|
25806
|
+
function collectFields(schema, casing, path55 = [], inheritedOptional = false) {
|
|
25807
25807
|
const fields = [];
|
|
25808
25808
|
for (const [key, rawChildSchema] of Object.entries(schema.shape)) {
|
|
25809
|
-
const nextPath = [...
|
|
25809
|
+
const nextPath = [...path55, key];
|
|
25810
25810
|
const optional = inheritedOptional || rawChildSchema.kind === "optional";
|
|
25811
25811
|
const childSchema = unwrapOptional(rawChildSchema);
|
|
25812
25812
|
if (childSchema.kind === "object") {
|
|
@@ -25829,9 +25829,9 @@ function collectFields(schema, casing, path54 = [], inheritedOptional = false) {
|
|
|
25829
25829
|
}
|
|
25830
25830
|
return fields;
|
|
25831
25831
|
}
|
|
25832
|
-
function toCommanderOptionAttribute(
|
|
25833
|
-
const optionAttribute = toOptionAttribute(
|
|
25834
|
-
const optionFlag = toOptionFlag(
|
|
25832
|
+
function toCommanderOptionAttribute(path55, casing) {
|
|
25833
|
+
const optionAttribute = toOptionAttribute(path55, casing);
|
|
25834
|
+
const optionFlag = toOptionFlag(path55, casing);
|
|
25835
25835
|
if (!GLOBAL_LONG_OPTION_FLAGS.has(optionFlag)) {
|
|
25836
25836
|
return optionAttribute;
|
|
25837
25837
|
}
|
|
@@ -26279,10 +26279,10 @@ function addGlobalOptions(command) {
|
|
|
26279
26279
|
throw new InvalidArgumentError('Invalid value for "--output". Expected one of: rich, md, json.');
|
|
26280
26280
|
}).option("--verbose", "Print stack traces for unexpected errors.");
|
|
26281
26281
|
}
|
|
26282
|
-
function setNestedValue(target,
|
|
26282
|
+
function setNestedValue(target, path55, value) {
|
|
26283
26283
|
let cursor = target;
|
|
26284
|
-
for (let index = 0; index <
|
|
26285
|
-
const segment =
|
|
26284
|
+
for (let index = 0; index < path55.length - 1; index += 1) {
|
|
26285
|
+
const segment = path55[index] ?? "";
|
|
26286
26286
|
const existing = cursor[segment];
|
|
26287
26287
|
if (typeof existing === "object" && existing !== null) {
|
|
26288
26288
|
cursor = existing;
|
|
@@ -26292,7 +26292,7 @@ function setNestedValue(target, path54, value) {
|
|
|
26292
26292
|
cursor[segment] = next;
|
|
26293
26293
|
cursor = next;
|
|
26294
26294
|
}
|
|
26295
|
-
const leaf =
|
|
26295
|
+
const leaf = path55[path55.length - 1];
|
|
26296
26296
|
if (leaf !== void 0) {
|
|
26297
26297
|
cursor[leaf] = value;
|
|
26298
26298
|
}
|
|
@@ -26382,13 +26382,13 @@ async function withOutputFormat2(output, fn) {
|
|
|
26382
26382
|
}
|
|
26383
26383
|
function createFs() {
|
|
26384
26384
|
return {
|
|
26385
|
-
readFile: async (
|
|
26386
|
-
writeFile: async (
|
|
26387
|
-
await writeFile7(
|
|
26385
|
+
readFile: async (path55, encoding = "utf8") => readFile12(path55, { encoding }),
|
|
26386
|
+
writeFile: async (path55, contents) => {
|
|
26387
|
+
await writeFile7(path55, contents);
|
|
26388
26388
|
},
|
|
26389
|
-
exists: async (
|
|
26389
|
+
exists: async (path55) => {
|
|
26390
26390
|
try {
|
|
26391
|
-
await access2(
|
|
26391
|
+
await access2(path55);
|
|
26392
26392
|
return true;
|
|
26393
26393
|
} catch {
|
|
26394
26394
|
return false;
|
|
@@ -26409,9 +26409,9 @@ function isPlainObject2(value) {
|
|
|
26409
26409
|
function hasFieldValue(value) {
|
|
26410
26410
|
return value !== void 0;
|
|
26411
26411
|
}
|
|
26412
|
-
function hasNestedField(fields,
|
|
26412
|
+
function hasNestedField(fields, path55) {
|
|
26413
26413
|
return fields.some(
|
|
26414
|
-
(field) =>
|
|
26414
|
+
(field) => path55.length < field.path.length && path55.every((segment, index) => field.path[index] === segment)
|
|
26415
26415
|
);
|
|
26416
26416
|
}
|
|
26417
26417
|
function describeExpectedPresetValue(schema) {
|
|
@@ -26495,9 +26495,9 @@ async function loadPresetValues(fields, presetPath) {
|
|
|
26495
26495
|
}
|
|
26496
26496
|
const fieldByPath = new Map(fields.map((field) => [field.displayPath, field]));
|
|
26497
26497
|
const presetValues = {};
|
|
26498
|
-
function visitObject(current,
|
|
26498
|
+
function visitObject(current, path55) {
|
|
26499
26499
|
for (const [key, value] of Object.entries(current)) {
|
|
26500
|
-
const nextPath = [...
|
|
26500
|
+
const nextPath = [...path55, key];
|
|
26501
26501
|
const displayPath = toDisplayPath3(nextPath);
|
|
26502
26502
|
const field = fieldByPath.get(displayPath);
|
|
26503
26503
|
if (field !== void 0) {
|
|
@@ -27608,13 +27608,19 @@ var init_agent2 = __esm({
|
|
|
27608
27608
|
});
|
|
27609
27609
|
|
|
27610
27610
|
// src/cli/commands/spawn.ts
|
|
27611
|
+
import path43 from "node:path";
|
|
27611
27612
|
import { Option as Option2 } from "commander";
|
|
27612
27613
|
function registerSpawnCommand(program, container, options = {}) {
|
|
27613
27614
|
const spawnServices = container.registry.list().filter((service) => typeof service.spawn === "function" || getSpawnConfig(service.name));
|
|
27614
27615
|
const extraServices = options.extraServices ?? [];
|
|
27615
27616
|
const serviceList = listSpawnServiceNames(spawnServices, extraServices);
|
|
27616
27617
|
const serviceDescription = `Agent to spawn${formatServiceList(serviceList)}`;
|
|
27617
|
-
program.command("spawn").alias("s").description("Run a single prompt through a configured agent CLI.").option("--model <model>", "Model identifier override passed to the agent CLI").option("-C, --cwd <path>", "Working directory or workspace locator for the agent CLI").option("--stdin", "Read the prompt from stdin").option("-i, --interactive", "Launch the agent in interactive TUI mode").option("--mode <mode>", "Permission mode: yolo | edit | read (default: yolo)").option(
|
|
27618
|
+
program.command("spawn").alias("s").description("Run a single prompt through a configured agent CLI.").option("--model <model>", "Model identifier override passed to the agent CLI").option("-C, --cwd <path>", "Working directory or workspace locator for the agent CLI").option("--stdin", "Read the prompt from stdin").option("-i, --interactive", "Launch the agent in interactive TUI mode").option("--mode <mode>", "Permission mode: yolo | edit | read (default: yolo)").option(
|
|
27619
|
+
"--mcp-servers <json|@file>",
|
|
27620
|
+
"MCP server config JSON (or @path/to/file.json): {name: {command, args?, env?}}"
|
|
27621
|
+
).addOption(
|
|
27622
|
+
new Option2("--mcp-config <json|@file>", "[deprecated: use --mcp-servers]").hideHelp()
|
|
27623
|
+
).option("--log-dir <path>", "Directory override for ACP JSONL spawn logs").option(
|
|
27618
27624
|
"--activity-timeout-ms <ms>",
|
|
27619
27625
|
"Kill the agent after N ms of inactivity",
|
|
27620
27626
|
(value) => parsePositiveInt(value, "--activity-timeout-ms")
|
|
@@ -27622,7 +27628,9 @@ function registerSpawnCommand(program, container, options = {}) {
|
|
|
27622
27628
|
const flags = resolveCommandFlags(program);
|
|
27623
27629
|
const commandOptions = this.opts();
|
|
27624
27630
|
const shouldEmitUiOutput = resolveOutputFormat() !== "json";
|
|
27625
|
-
const
|
|
27631
|
+
const rawMcpInput = commandOptions.mcpServers ?? commandOptions.mcpConfig;
|
|
27632
|
+
const mcpInput = await resolveMcpSpawnInput(rawMcpInput, container.fs, container.env.cwd);
|
|
27633
|
+
const mcpServers = parseMcpSpawnConfig2(mcpInput);
|
|
27626
27634
|
const wantsStdinFlag = commandOptions.stdin === true;
|
|
27627
27635
|
const shouldReadFromStdin = wantsStdinFlag || promptText === "-" || !promptText && !process.stdin.isTTY;
|
|
27628
27636
|
const forwardedArgs = wantsStdinFlag ? [...promptText ? [promptText] : [], ...agentArgs] : agentArgs;
|
|
@@ -27870,6 +27878,26 @@ async function confirmUnconfiguredService(container, service, label, flags) {
|
|
|
27870
27878
|
}
|
|
27871
27879
|
return shouldProceed === true;
|
|
27872
27880
|
}
|
|
27881
|
+
async function resolveMcpSpawnInput(input, fs3, baseDir) {
|
|
27882
|
+
if (!input) {
|
|
27883
|
+
return void 0;
|
|
27884
|
+
}
|
|
27885
|
+
if (!input.startsWith("@")) {
|
|
27886
|
+
return input;
|
|
27887
|
+
}
|
|
27888
|
+
const rawPath = input.slice(1);
|
|
27889
|
+
if (rawPath.length === 0) {
|
|
27890
|
+
throw new ValidationError("--mcp-servers @<path> requires a file path after '@'");
|
|
27891
|
+
}
|
|
27892
|
+
const filePath = path43.isAbsolute(rawPath) ? rawPath : path43.join(baseDir, rawPath);
|
|
27893
|
+
try {
|
|
27894
|
+
return await fs3.readFile(filePath, "utf8");
|
|
27895
|
+
} catch (error2) {
|
|
27896
|
+
throw new ValidationError(
|
|
27897
|
+
`--mcp-servers could not read file "${filePath}": ${error2.message}`
|
|
27898
|
+
);
|
|
27899
|
+
}
|
|
27900
|
+
}
|
|
27873
27901
|
function parseMcpSpawnConfig2(input) {
|
|
27874
27902
|
if (!input) {
|
|
27875
27903
|
return void 0;
|
|
@@ -28808,7 +28836,7 @@ var init_media_download = __esm({
|
|
|
28808
28836
|
});
|
|
28809
28837
|
|
|
28810
28838
|
// src/cli/commands/generate.ts
|
|
28811
|
-
import
|
|
28839
|
+
import path44 from "node:path";
|
|
28812
28840
|
function registerGenerateCommand(program, container) {
|
|
28813
28841
|
const generate2 = program.command("generate").alias("g").description("Generate content via Poe API.").option("--model <model>", `Model identifier (default: ${DEFAULT_TEXT_MODEL})`).option(
|
|
28814
28842
|
"--param <key=value>",
|
|
@@ -29081,11 +29109,11 @@ function getDefaultMimeType(type) {
|
|
|
29081
29109
|
return defaults[type];
|
|
29082
29110
|
}
|
|
29083
29111
|
function resolveOutputPath(filename, cwd) {
|
|
29084
|
-
if (
|
|
29112
|
+
if (path44.isAbsolute(filename)) {
|
|
29085
29113
|
return { path: filename, label: filename };
|
|
29086
29114
|
}
|
|
29087
29115
|
return {
|
|
29088
|
-
path:
|
|
29116
|
+
path: path44.join(cwd, filename),
|
|
29089
29117
|
label: `./${filename}`
|
|
29090
29118
|
};
|
|
29091
29119
|
}
|
|
@@ -30471,10 +30499,10 @@ var init_shapes = __esm({
|
|
|
30471
30499
|
});
|
|
30472
30500
|
|
|
30473
30501
|
// packages/agent-mcp-config/src/apply.ts
|
|
30474
|
-
import
|
|
30502
|
+
import path45 from "node:path";
|
|
30475
30503
|
import { parse as parseYaml3, stringify as stringifyYaml2 } from "yaml";
|
|
30476
30504
|
function getConfigDirectory(configPath) {
|
|
30477
|
-
return
|
|
30505
|
+
return path45.dirname(configPath);
|
|
30478
30506
|
}
|
|
30479
30507
|
function isConfigObject6(value) {
|
|
30480
30508
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
@@ -30494,9 +30522,9 @@ function expandHomePath(configPath, homeDir) {
|
|
|
30494
30522
|
return homeDir;
|
|
30495
30523
|
}
|
|
30496
30524
|
if (configPath.startsWith("~/")) {
|
|
30497
|
-
return
|
|
30525
|
+
return path45.join(homeDir, configPath.slice(2));
|
|
30498
30526
|
}
|
|
30499
|
-
return
|
|
30527
|
+
return path45.join(homeDir, configPath.slice(1));
|
|
30500
30528
|
}
|
|
30501
30529
|
function parseYamlDocument2(content) {
|
|
30502
30530
|
if (content.trim() === "") {
|
|
@@ -30529,7 +30557,7 @@ async function writeYamlConfig(configPath, document, options) {
|
|
|
30529
30557
|
return;
|
|
30530
30558
|
}
|
|
30531
30559
|
const absolutePath = expandHomePath(configPath, options.homeDir);
|
|
30532
|
-
const configDir =
|
|
30560
|
+
const configDir = path45.dirname(absolutePath);
|
|
30533
30561
|
await options.fs.mkdir(configDir, { recursive: true });
|
|
30534
30562
|
await options.fs.writeFile(absolutePath, serializeYamlDocument(document), {
|
|
30535
30563
|
encoding: "utf8"
|
|
@@ -30853,7 +30881,7 @@ var init_mcp2 = __esm({
|
|
|
30853
30881
|
|
|
30854
30882
|
// packages/agent-skill-config/src/configs.ts
|
|
30855
30883
|
import os4 from "node:os";
|
|
30856
|
-
import
|
|
30884
|
+
import path46 from "node:path";
|
|
30857
30885
|
function resolveAgentSupport2(input, registry = agentSkillConfigs) {
|
|
30858
30886
|
const resolvedId = resolveAgentId(input);
|
|
30859
30887
|
if (!resolvedId) {
|
|
@@ -31940,7 +31968,7 @@ var init_models2 = __esm({
|
|
|
31940
31968
|
});
|
|
31941
31969
|
|
|
31942
31970
|
// src/cli/commands/pipeline.ts
|
|
31943
|
-
import
|
|
31971
|
+
import path47 from "node:path";
|
|
31944
31972
|
import { readFile as readFile13, stat as stat12 } from "node:fs/promises";
|
|
31945
31973
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
31946
31974
|
async function resolvePipelinePlanDirectory(container) {
|
|
@@ -31997,11 +32025,11 @@ function formatRunSummary(result) {
|
|
|
31997
32025
|
].join("\n ");
|
|
31998
32026
|
}
|
|
31999
32027
|
function resolvePipelinePaths(scope, cwd, homeDir) {
|
|
32000
|
-
const rootPath = scope === "global" ?
|
|
32028
|
+
const rootPath = scope === "global" ? path47.join(homeDir, ".poe-code", "pipeline") : path47.join(cwd, ".poe-code", "pipeline");
|
|
32001
32029
|
const displayRoot = scope === "global" ? "~/.poe-code/pipeline" : ".poe-code/pipeline";
|
|
32002
32030
|
return {
|
|
32003
|
-
plansPath:
|
|
32004
|
-
stepsPath:
|
|
32031
|
+
plansPath: path47.join(rootPath, "plans"),
|
|
32032
|
+
stepsPath: path47.join(rootPath, "steps.yaml"),
|
|
32005
32033
|
displayPlansPath: `${displayRoot}/plans`,
|
|
32006
32034
|
displayStepsPath: `${displayRoot}/steps.yaml`
|
|
32007
32035
|
};
|
|
@@ -32012,16 +32040,16 @@ async function loadPipelineTemplates() {
|
|
|
32012
32040
|
}
|
|
32013
32041
|
const packageRoot = await findPackageRoot(fileURLToPath7(import.meta.url));
|
|
32014
32042
|
const templateRoots = [
|
|
32015
|
-
|
|
32016
|
-
|
|
32043
|
+
path47.join(packageRoot, "src", "templates", "pipeline"),
|
|
32044
|
+
path47.join(packageRoot, "dist", "templates", "pipeline")
|
|
32017
32045
|
];
|
|
32018
32046
|
for (const templateRoot of templateRoots) {
|
|
32019
32047
|
if (!await pathExistsOnDisk(templateRoot)) {
|
|
32020
32048
|
continue;
|
|
32021
32049
|
}
|
|
32022
32050
|
const [skillPlan, steps] = await Promise.all([
|
|
32023
|
-
readFile13(
|
|
32024
|
-
readFile13(
|
|
32051
|
+
readFile13(path47.join(templateRoot, "SKILL_plan.md"), "utf8"),
|
|
32052
|
+
readFile13(path47.join(templateRoot, "steps.yaml.mustache"), "utf8")
|
|
32025
32053
|
]);
|
|
32026
32054
|
pipelineTemplatesCache = { skillPlan, steps };
|
|
32027
32055
|
return pipelineTemplatesCache;
|
|
@@ -32040,12 +32068,12 @@ async function pathExistsOnDisk(targetPath) {
|
|
|
32040
32068
|
}
|
|
32041
32069
|
}
|
|
32042
32070
|
async function findPackageRoot(entryFilePath) {
|
|
32043
|
-
let currentPath =
|
|
32071
|
+
let currentPath = path47.dirname(entryFilePath);
|
|
32044
32072
|
while (true) {
|
|
32045
|
-
if (await pathExistsOnDisk(
|
|
32073
|
+
if (await pathExistsOnDisk(path47.join(currentPath, "package.json"))) {
|
|
32046
32074
|
return currentPath;
|
|
32047
32075
|
}
|
|
32048
|
-
const parentPath =
|
|
32076
|
+
const parentPath = path47.dirname(currentPath);
|
|
32049
32077
|
if (parentPath === currentPath) {
|
|
32050
32078
|
throw new Error("Unable to locate package root for Pipeline templates.");
|
|
32051
32079
|
}
|
|
@@ -32403,7 +32431,7 @@ function registerPipelineCommand(program, container) {
|
|
|
32403
32431
|
`Would ${stepsExists ? "overwrite" : "create"}: ${pipelinePaths.displayStepsPath}`
|
|
32404
32432
|
);
|
|
32405
32433
|
} else {
|
|
32406
|
-
await container.fs.mkdir(
|
|
32434
|
+
await container.fs.mkdir(path47.dirname(pipelinePaths.stepsPath), {
|
|
32407
32435
|
recursive: true
|
|
32408
32436
|
});
|
|
32409
32437
|
await container.fs.writeFile(pipelinePaths.stepsPath, templates2.steps, {
|
|
@@ -32442,7 +32470,7 @@ var init_pipeline3 = __esm({
|
|
|
32442
32470
|
});
|
|
32443
32471
|
|
|
32444
32472
|
// packages/plan-browser/src/format.ts
|
|
32445
|
-
import
|
|
32473
|
+
import path48 from "node:path";
|
|
32446
32474
|
function isPipelineTaskDone(task) {
|
|
32447
32475
|
if (typeof task.status === "string") {
|
|
32448
32476
|
return task.status === "done";
|
|
@@ -32532,9 +32560,9 @@ function formatPipelinePlanMarkdown(options) {
|
|
|
32532
32560
|
return lines.join("\n").trimEnd();
|
|
32533
32561
|
}
|
|
32534
32562
|
function resolveExperimentJournalPath(absolutePath) {
|
|
32535
|
-
return
|
|
32536
|
-
|
|
32537
|
-
`${
|
|
32563
|
+
return path48.join(
|
|
32564
|
+
path48.dirname(absolutePath),
|
|
32565
|
+
`${path48.basename(absolutePath, path48.extname(absolutePath))}.journal.jsonl`
|
|
32538
32566
|
);
|
|
32539
32567
|
}
|
|
32540
32568
|
async function readExperimentState(fs3, absolutePath) {
|
|
@@ -32557,7 +32585,7 @@ async function loadPlanPreviewMarkdown(entry, fs3) {
|
|
|
32557
32585
|
}
|
|
32558
32586
|
async function readPlanMetadata(options) {
|
|
32559
32587
|
const content = await options.fs.readFile(options.absolutePath, "utf8");
|
|
32560
|
-
const fallbackName =
|
|
32588
|
+
const fallbackName = path48.basename(options.path);
|
|
32561
32589
|
if (options.source === "pipeline") {
|
|
32562
32590
|
return {
|
|
32563
32591
|
title: fallbackName,
|
|
@@ -32591,7 +32619,7 @@ var init_format = __esm({
|
|
|
32591
32619
|
});
|
|
32592
32620
|
|
|
32593
32621
|
// packages/plan-browser/src/discovery.ts
|
|
32594
|
-
import
|
|
32622
|
+
import path49 from "node:path";
|
|
32595
32623
|
import * as fsPromises11 from "node:fs/promises";
|
|
32596
32624
|
function createDefaultFs9() {
|
|
32597
32625
|
return {
|
|
@@ -32618,15 +32646,15 @@ function isNotFound5(error2) {
|
|
|
32618
32646
|
}
|
|
32619
32647
|
function resolveAbsoluteDirectory2(dir, cwd, homeDir) {
|
|
32620
32648
|
if (dir.startsWith("~/")) {
|
|
32621
|
-
return
|
|
32649
|
+
return path49.join(homeDir, dir.slice(2));
|
|
32622
32650
|
}
|
|
32623
|
-
return
|
|
32651
|
+
return path49.isAbsolute(dir) ? dir : path49.resolve(cwd, dir);
|
|
32624
32652
|
}
|
|
32625
32653
|
function resolveAbsoluteDisplayPath(displayPath, cwd, homeDir) {
|
|
32626
32654
|
if (displayPath.startsWith("~/")) {
|
|
32627
|
-
return
|
|
32655
|
+
return path49.join(homeDir, displayPath.slice(2));
|
|
32628
32656
|
}
|
|
32629
|
-
return
|
|
32657
|
+
return path49.isAbsolute(displayPath) ? displayPath : path49.resolve(cwd, displayPath);
|
|
32630
32658
|
}
|
|
32631
32659
|
function isPipelinePlanFile(name) {
|
|
32632
32660
|
const lower = name.toLowerCase();
|
|
@@ -32663,12 +32691,12 @@ async function scanDirectory(options) {
|
|
|
32663
32691
|
if (!options.include(name)) {
|
|
32664
32692
|
continue;
|
|
32665
32693
|
}
|
|
32666
|
-
const absolutePath =
|
|
32694
|
+
const absolutePath = path49.join(options.absoluteDir, name);
|
|
32667
32695
|
const stat15 = await options.fs.stat(absolutePath);
|
|
32668
32696
|
if (!stat15.isFile()) {
|
|
32669
32697
|
continue;
|
|
32670
32698
|
}
|
|
32671
|
-
const displayPath =
|
|
32699
|
+
const displayPath = path49.join(options.displayDir, name);
|
|
32672
32700
|
const metadata = await readPlanMetadata({
|
|
32673
32701
|
source: options.source,
|
|
32674
32702
|
absolutePath,
|
|
@@ -32701,11 +32729,11 @@ async function discoverPipelinePlans(options) {
|
|
|
32701
32729
|
displayDir: configuredDir
|
|
32702
32730
|
}] : [
|
|
32703
32731
|
{
|
|
32704
|
-
absoluteDir:
|
|
32732
|
+
absoluteDir: path49.join(options.cwd, ".poe-code", "pipeline", "plans"),
|
|
32705
32733
|
displayDir: ".poe-code/pipeline/plans"
|
|
32706
32734
|
},
|
|
32707
32735
|
{
|
|
32708
|
-
absoluteDir:
|
|
32736
|
+
absoluteDir: path49.join(options.homeDir, ".poe-code", "pipeline", "plans"),
|
|
32709
32737
|
displayDir: "~/.poe-code/pipeline/plans"
|
|
32710
32738
|
}
|
|
32711
32739
|
];
|
|
@@ -32737,11 +32765,11 @@ async function discoverExperimentPlans(options) {
|
|
|
32737
32765
|
displayDir: configuredDir
|
|
32738
32766
|
}] : [
|
|
32739
32767
|
{
|
|
32740
|
-
absoluteDir:
|
|
32768
|
+
absoluteDir: path49.join(options.cwd, ".poe-code", "experiments"),
|
|
32741
32769
|
displayDir: ".poe-code/experiments"
|
|
32742
32770
|
},
|
|
32743
32771
|
{
|
|
32744
|
-
absoluteDir:
|
|
32772
|
+
absoluteDir: path49.join(options.homeDir, ".poe-code", "experiments"),
|
|
32745
32773
|
displayDir: "~/.poe-code/experiments"
|
|
32746
32774
|
}
|
|
32747
32775
|
];
|
|
@@ -32839,7 +32867,7 @@ var init_discovery4 = __esm({
|
|
|
32839
32867
|
});
|
|
32840
32868
|
|
|
32841
32869
|
// packages/plan-browser/src/actions.ts
|
|
32842
|
-
import
|
|
32870
|
+
import path50 from "node:path";
|
|
32843
32871
|
import { spawnSync as nodeSpawnSync } from "node:child_process";
|
|
32844
32872
|
function resolveEditor2(env = process.env) {
|
|
32845
32873
|
const editor = env.EDITOR?.trim() || env.VISUAL?.trim() || "vi";
|
|
@@ -32851,8 +32879,8 @@ function editPlan(absolutePath, options = {}) {
|
|
|
32851
32879
|
spawnSync3(editor, [absolutePath], { stdio: "inherit" });
|
|
32852
32880
|
}
|
|
32853
32881
|
async function archivePlan3(entry, fs3) {
|
|
32854
|
-
const archiveDir =
|
|
32855
|
-
const archivedPath =
|
|
32882
|
+
const archiveDir = path50.join(path50.dirname(entry.absolutePath), "archive");
|
|
32883
|
+
const archivedPath = path50.join(archiveDir, path50.basename(entry.absolutePath));
|
|
32856
32884
|
await fs3.mkdir(archiveDir, { recursive: true });
|
|
32857
32885
|
await fs3.rename(entry.absolutePath, archivedPath);
|
|
32858
32886
|
return archivedPath;
|
|
@@ -32867,7 +32895,7 @@ var init_actions = __esm({
|
|
|
32867
32895
|
});
|
|
32868
32896
|
|
|
32869
32897
|
// packages/plan-browser/src/browser.ts
|
|
32870
|
-
import
|
|
32898
|
+
import path51 from "node:path";
|
|
32871
32899
|
async function runPlanBrowser(options) {
|
|
32872
32900
|
const renderPlanPreview = async (entry) => {
|
|
32873
32901
|
const markdown = await loadPlanPreviewMarkdown(entry, options.fs);
|
|
@@ -32896,7 +32924,7 @@ async function runPlanBrowser(options) {
|
|
|
32896
32924
|
const selectedPath = await select2({
|
|
32897
32925
|
message: "Select a plan",
|
|
32898
32926
|
options: plans.map((plan) => ({
|
|
32899
|
-
label: text.selectLabel(
|
|
32927
|
+
label: text.selectLabel(path51.basename(plan.path), plan.status),
|
|
32900
32928
|
hint: plan.source,
|
|
32901
32929
|
value: plan.absolutePath
|
|
32902
32930
|
}))
|
|
@@ -32932,7 +32960,7 @@ async function runPlanBrowser(options) {
|
|
|
32932
32960
|
if (action === "archive") {
|
|
32933
32961
|
try {
|
|
32934
32962
|
const confirmed = options.assumeYes || await confirmOrCancel({
|
|
32935
|
-
message: `Archive ${
|
|
32963
|
+
message: `Archive ${path51.basename(selectedPlan.path)}?`,
|
|
32936
32964
|
initialValue: true
|
|
32937
32965
|
});
|
|
32938
32966
|
if (confirmed) {
|
|
@@ -32947,7 +32975,7 @@ async function runPlanBrowser(options) {
|
|
|
32947
32975
|
}
|
|
32948
32976
|
try {
|
|
32949
32977
|
const confirmed = options.assumeYes || await confirmOrCancel({
|
|
32950
|
-
message: `Permanently delete ${
|
|
32978
|
+
message: `Permanently delete ${path51.basename(selectedPlan.path)}?`,
|
|
32951
32979
|
initialValue: true
|
|
32952
32980
|
});
|
|
32953
32981
|
if (confirmed) {
|
|
@@ -32983,7 +33011,7 @@ var init_src25 = __esm({
|
|
|
32983
33011
|
});
|
|
32984
33012
|
|
|
32985
33013
|
// src/cli/commands/plan.ts
|
|
32986
|
-
import
|
|
33014
|
+
import path52 from "node:path";
|
|
32987
33015
|
function resolvePlanCommandOptions(command) {
|
|
32988
33016
|
const localOptions = command.opts();
|
|
32989
33017
|
const parentOptions = command.parent?.opts() ?? {};
|
|
@@ -33034,7 +33062,7 @@ async function discoverPlans(container, source) {
|
|
|
33034
33062
|
async function resolveSelectedPlan(options) {
|
|
33035
33063
|
const providedPath = options.providedPath?.trim();
|
|
33036
33064
|
if (providedPath) {
|
|
33037
|
-
const resolvedAbsolute = providedPath.startsWith("~/") ?
|
|
33065
|
+
const resolvedAbsolute = providedPath.startsWith("~/") ? path52.join(options.container.env.homeDir, providedPath.slice(2)) : path52.isAbsolute(providedPath) ? providedPath : path52.resolve(options.container.env.cwd, providedPath);
|
|
33038
33066
|
const matched2 = options.plans.find(
|
|
33039
33067
|
(plan) => plan.path === providedPath || plan.absolutePath === providedPath || plan.absolutePath === resolvedAbsolute
|
|
33040
33068
|
);
|
|
@@ -33052,7 +33080,7 @@ async function resolveSelectedPlan(options) {
|
|
|
33052
33080
|
const selected = await select2({
|
|
33053
33081
|
message: options.promptMessage,
|
|
33054
33082
|
options: options.plans.map((plan) => ({
|
|
33055
|
-
label: text.selectLabel(
|
|
33083
|
+
label: text.selectLabel(path52.basename(plan.path), plan.status),
|
|
33056
33084
|
hint: plan.source,
|
|
33057
33085
|
value: plan.absolutePath
|
|
33058
33086
|
}))
|
|
@@ -33088,7 +33116,7 @@ async function renderPlanList(container, options) {
|
|
|
33088
33116
|
JSON.stringify(
|
|
33089
33117
|
plans.map((plan) => ({
|
|
33090
33118
|
source: plan.source,
|
|
33091
|
-
name:
|
|
33119
|
+
name: path52.basename(plan.path),
|
|
33092
33120
|
path: plan.path,
|
|
33093
33121
|
detail: plan.status,
|
|
33094
33122
|
updated: formatDate2(plan.updatedAt)
|
|
@@ -33111,7 +33139,7 @@ async function renderPlanList(container, options) {
|
|
|
33111
33139
|
],
|
|
33112
33140
|
rows: plans.map((plan) => ({
|
|
33113
33141
|
source: plan.source,
|
|
33114
|
-
name:
|
|
33142
|
+
name: path52.basename(plan.path),
|
|
33115
33143
|
detail: plan.status,
|
|
33116
33144
|
updated: formatDate2(plan.updatedAt)
|
|
33117
33145
|
}))
|
|
@@ -33143,7 +33171,7 @@ async function executePlanAction(options) {
|
|
|
33143
33171
|
}
|
|
33144
33172
|
if (!flags.assumeYes) {
|
|
33145
33173
|
const confirmed = await confirmOrCancel({
|
|
33146
|
-
message: options.action === "archive" ? `Archive ${
|
|
33174
|
+
message: options.action === "archive" ? `Archive ${path52.basename(plan.path)}?` : `Permanently delete ${path52.basename(plan.path)}?`,
|
|
33147
33175
|
initialValue: true
|
|
33148
33176
|
});
|
|
33149
33177
|
if (!confirmed) {
|
|
@@ -33263,7 +33291,7 @@ var init_plan = __esm({
|
|
|
33263
33291
|
});
|
|
33264
33292
|
|
|
33265
33293
|
// src/cli/commands/ralph.ts
|
|
33266
|
-
import
|
|
33294
|
+
import path53 from "node:path";
|
|
33267
33295
|
function formatDuration2(ms) {
|
|
33268
33296
|
const totalSeconds = Math.round(ms / 1e3);
|
|
33269
33297
|
const minutes = Math.floor(totalSeconds / 60);
|
|
@@ -33299,9 +33327,9 @@ function normalizeConfiguredIterations(value) {
|
|
|
33299
33327
|
}
|
|
33300
33328
|
function resolveAbsoluteDocPath(container, docPath) {
|
|
33301
33329
|
if (docPath.startsWith("~/")) {
|
|
33302
|
-
return
|
|
33330
|
+
return path53.join(container.env.homeDir, docPath.slice(2));
|
|
33303
33331
|
}
|
|
33304
|
-
return
|
|
33332
|
+
return path53.isAbsolute(docPath) ? docPath : path53.resolve(container.env.cwd, docPath);
|
|
33305
33333
|
}
|
|
33306
33334
|
async function resolvePlanDirectory2(container) {
|
|
33307
33335
|
const configDoc = await readMergedDocument(
|
|
@@ -33672,11 +33700,11 @@ var init_ralph3 = __esm({
|
|
|
33672
33700
|
});
|
|
33673
33701
|
|
|
33674
33702
|
// src/cli/commands/experiment.ts
|
|
33675
|
-
import
|
|
33703
|
+
import path54 from "node:path";
|
|
33676
33704
|
import { readFile as readFile15, stat as stat14 } from "node:fs/promises";
|
|
33677
33705
|
import { fileURLToPath as fileURLToPath8 } from "node:url";
|
|
33678
33706
|
function resolveExperimentPaths(scope, cwd, homeDir) {
|
|
33679
|
-
const rootPath = scope === "global" ?
|
|
33707
|
+
const rootPath = scope === "global" ? path54.join(homeDir, ".poe-code", "experiments") : path54.join(cwd, ".poe-code", "experiments");
|
|
33680
33708
|
const displayRoot = scope === "global" ? "~/.poe-code/experiments" : ".poe-code/experiments";
|
|
33681
33709
|
return {
|
|
33682
33710
|
experimentsPath: rootPath,
|
|
@@ -33695,12 +33723,12 @@ async function pathExistsOnDisk2(targetPath) {
|
|
|
33695
33723
|
}
|
|
33696
33724
|
}
|
|
33697
33725
|
async function findPackageRoot2(entryFilePath) {
|
|
33698
|
-
let currentPath =
|
|
33726
|
+
let currentPath = path54.dirname(entryFilePath);
|
|
33699
33727
|
while (true) {
|
|
33700
|
-
if (await pathExistsOnDisk2(
|
|
33728
|
+
if (await pathExistsOnDisk2(path54.join(currentPath, "package.json"))) {
|
|
33701
33729
|
return currentPath;
|
|
33702
33730
|
}
|
|
33703
|
-
const parentPath =
|
|
33731
|
+
const parentPath = path54.dirname(currentPath);
|
|
33704
33732
|
if (parentPath === currentPath) {
|
|
33705
33733
|
throw new Error("Unable to locate package root for Experiment templates.");
|
|
33706
33734
|
}
|
|
@@ -33713,16 +33741,16 @@ async function loadExperimentTemplates() {
|
|
|
33713
33741
|
}
|
|
33714
33742
|
const packageRoot = await findPackageRoot2(fileURLToPath8(import.meta.url));
|
|
33715
33743
|
const templateRoots = [
|
|
33716
|
-
|
|
33717
|
-
|
|
33744
|
+
path54.join(packageRoot, "src", "templates", "experiment"),
|
|
33745
|
+
path54.join(packageRoot, "dist", "templates", "experiment")
|
|
33718
33746
|
];
|
|
33719
33747
|
for (const templateRoot of templateRoots) {
|
|
33720
33748
|
if (!await pathExistsOnDisk2(templateRoot)) {
|
|
33721
33749
|
continue;
|
|
33722
33750
|
}
|
|
33723
33751
|
const [skillPlan, runYaml] = await Promise.all([
|
|
33724
|
-
readFile15(
|
|
33725
|
-
readFile15(
|
|
33752
|
+
readFile15(path54.join(templateRoot, "SKILL_experiment.md"), "utf8"),
|
|
33753
|
+
readFile15(path54.join(templateRoot, "run.yaml.mustache"), "utf8")
|
|
33726
33754
|
]);
|
|
33727
33755
|
experimentTemplatesCache = { skillPlan, runYaml };
|
|
33728
33756
|
return experimentTemplatesCache;
|
|
@@ -34224,8 +34252,8 @@ function registerExperimentCommand(program, container) {
|
|
|
34224
34252
|
);
|
|
34225
34253
|
}
|
|
34226
34254
|
}
|
|
34227
|
-
const runYamlPath =
|
|
34228
|
-
const runYamlDisplayPath =
|
|
34255
|
+
const runYamlPath = path54.join(experimentPaths.experimentsPath, "run.yaml");
|
|
34256
|
+
const runYamlDisplayPath = path54.join(experimentPaths.displayExperimentsPath, "run.yaml");
|
|
34229
34257
|
if (!await pathExists4(container.fs, runYamlPath)) {
|
|
34230
34258
|
if (flags.dryRun) {
|
|
34231
34259
|
resources.logger.dryRun(`Would create: ${runYamlDisplayPath}`);
|
|
@@ -34691,7 +34719,7 @@ var init_package = __esm({
|
|
|
34691
34719
|
"package.json"() {
|
|
34692
34720
|
package_default = {
|
|
34693
34721
|
name: "poe-code",
|
|
34694
|
-
version: "3.0.
|
|
34722
|
+
version: "3.0.176",
|
|
34695
34723
|
description: "CLI tool to configure Poe API for developer workflows.",
|
|
34696
34724
|
type: "module",
|
|
34697
34725
|
main: "./dist/index.js",
|
|
@@ -34891,22 +34919,22 @@ function formatCommandHeader(cmd) {
|
|
|
34891
34919
|
}
|
|
34892
34920
|
return `Poe - ${parts.reverse().join(" ")}`;
|
|
34893
34921
|
}
|
|
34894
|
-
function findCommandByPath(root,
|
|
34922
|
+
function findCommandByPath(root, path55) {
|
|
34895
34923
|
let current = root;
|
|
34896
|
-
for (const segment of
|
|
34924
|
+
for (const segment of path55) {
|
|
34897
34925
|
const next = current.commands.find(
|
|
34898
34926
|
(command) => Reflect.get(command, "_hidden") !== true && command.name() === segment
|
|
34899
34927
|
);
|
|
34900
34928
|
if (!next) {
|
|
34901
|
-
throw new Error(`Root help command is missing: ${
|
|
34929
|
+
throw new Error(`Root help command is missing: ${path55.join(" ")}`);
|
|
34902
34930
|
}
|
|
34903
34931
|
current = next;
|
|
34904
34932
|
}
|
|
34905
34933
|
return current;
|
|
34906
34934
|
}
|
|
34907
|
-
function formatRootHelpCommandName(
|
|
34935
|
+
function formatRootHelpCommandName(path55, command) {
|
|
34908
34936
|
const leaf = [command.name(), ...command.aliases()].join(", ");
|
|
34909
|
-
return
|
|
34937
|
+
return path55.length > 1 ? [...path55.slice(0, -1), leaf].join(" ") : leaf;
|
|
34910
34938
|
}
|
|
34911
34939
|
function splitUsageParts(usage) {
|
|
34912
34940
|
return usage.split(" ").map((part) => part.trim()).filter((part) => part.length > 0);
|