poe-code 3.0.214 → 3.0.216
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 +0 -2
- package/dist/cli/commands/pipeline.js +72 -3
- package/dist/cli/commands/pipeline.js.map +1 -1
- package/dist/cli/commands/tasks-options.d.ts +19 -0
- package/dist/cli/commands/tasks-options.js +144 -0
- package/dist/cli/commands/tasks-options.js.map +1 -0
- package/dist/cli/commands/tasks.d.ts +3 -0
- package/dist/cli/commands/tasks.js +144 -0
- package/dist/cli/commands/tasks.js.map +1 -0
- package/dist/cli/program.js +92 -1
- package/dist/cli/program.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +41803 -39205
- package/dist/index.js.map +4 -4
- package/dist/prompts/github-issue-opened.md +3 -3
- package/dist/providers/claude-code.js +2800 -2655
- package/dist/providers/claude-code.js.map +4 -4
- package/dist/providers/codex.js +2853 -2708
- package/dist/providers/codex.js.map +4 -4
- package/dist/providers/goose.js +2797 -2652
- package/dist/providers/goose.js.map +4 -4
- package/dist/providers/kimi.js +2800 -2655
- package/dist/providers/kimi.js.map +4 -4
- package/dist/providers/opencode.js +2800 -2655
- package/dist/providers/opencode.js.map +4 -4
- package/dist/providers/poe-agent.js +4926 -2095
- package/dist/providers/poe-agent.js.map +4 -4
- package/package.json +3 -1
- package/packages/memory/dist/index.js +1625 -1482
- package/packages/memory/dist/index.js.map +4 -4
- package/packages/superintendent/dist/commands/run.js +9 -64
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import * as fsPromises from "node:fs/promises";
|
|
3
3
|
import { spawn as nodeSpawn, spawnSync as nodeSpawnSync } from "node:child_process";
|
|
4
|
-
import { resolveLoopAgent, resolveRunLogDir, resolveWorkflowPath } from "@poe-code/agent-harness-tools";
|
|
4
|
+
import { discoverPlans, resolveLoopAgent, resolveRunLogDir, resolveWorkflowPath } from "@poe-code/agent-harness-tools";
|
|
5
5
|
import { applyMiddlewares, getSpawnConfig, renderAcpStream, sessionCapture, spawn, spawnLog, spawnStreaming, usageCapture } from "@poe-code/agent-spawn";
|
|
6
6
|
import { parseAgentSpecifier } from "@poe-code/agent-defs";
|
|
7
7
|
import { executePoeAgent } from "./poe-agent-runner.js";
|
|
@@ -639,25 +639,26 @@ async function resolveDocPath(options) {
|
|
|
639
639
|
}
|
|
640
640
|
const planDirectory = options.planDirectory ??
|
|
641
641
|
(await resolveSuperintendentPlanDirectory(options.cwd, options.homeDir, options.env, options.fs));
|
|
642
|
-
const docs = await
|
|
642
|
+
const docs = await discoverPlans({
|
|
643
643
|
cwd: options.cwd,
|
|
644
644
|
homeDir: options.homeDir,
|
|
645
|
-
planDirectory,
|
|
645
|
+
planDirectory: planDirectory ?? "docs/plans",
|
|
646
|
+
kinds: ["superintendent"],
|
|
646
647
|
fs: options.fs
|
|
647
648
|
});
|
|
648
649
|
if (docs.length === 0) {
|
|
649
650
|
throw new UserError("No superintendent documents found.");
|
|
650
651
|
}
|
|
651
652
|
if (options.assumeYes || !options.interactive) {
|
|
652
|
-
return docs[0];
|
|
653
|
+
return docs[0].absolutePath;
|
|
653
654
|
}
|
|
654
655
|
const selected = await options.selectPrompt({
|
|
655
656
|
message: "Select superintendent document",
|
|
656
|
-
options: docs.map((
|
|
657
|
-
label: displayPath
|
|
658
|
-
value:
|
|
657
|
+
options: docs.map((doc) => ({
|
|
658
|
+
label: doc.displayPath,
|
|
659
|
+
value: doc.absolutePath
|
|
659
660
|
})),
|
|
660
|
-
initialValue: docs[0]
|
|
661
|
+
initialValue: docs[0].absolutePath
|
|
661
662
|
});
|
|
662
663
|
if (isCancel(selected)) {
|
|
663
664
|
cancel("Operation cancelled.");
|
|
@@ -665,46 +666,6 @@ async function resolveDocPath(options) {
|
|
|
665
666
|
}
|
|
666
667
|
return selected;
|
|
667
668
|
}
|
|
668
|
-
async function discoverSuperintendentDocs(options) {
|
|
669
|
-
const docs = await listPlanDirectoryDocs(options.fs, options.planDirectory, options.cwd, options.homeDir);
|
|
670
|
-
const matches = [];
|
|
671
|
-
for (const docPath of docs) {
|
|
672
|
-
try {
|
|
673
|
-
const content = await options.fs.readFile(docPath, "utf8");
|
|
674
|
-
const document = parseSuperintendentDoc(docPath, content);
|
|
675
|
-
if (document.frontmatter.kind === "superintendent") {
|
|
676
|
-
matches.push(docPath);
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
catch {
|
|
680
|
-
// Ignore invalid docs during discovery.
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
return matches;
|
|
684
|
-
}
|
|
685
|
-
async function listPlanDirectoryDocs(fs, planDirectory, cwd, homeDir) {
|
|
686
|
-
const absoluteDir = resolveAbsolutePlanDirectory(planDirectory, cwd, homeDir);
|
|
687
|
-
let entries;
|
|
688
|
-
try {
|
|
689
|
-
entries = await fs.readdir(absoluteDir);
|
|
690
|
-
}
|
|
691
|
-
catch (error) {
|
|
692
|
-
if (isMissingDirectory(error)) {
|
|
693
|
-
return [];
|
|
694
|
-
}
|
|
695
|
-
throw error;
|
|
696
|
-
}
|
|
697
|
-
return entries
|
|
698
|
-
.filter((entry) => entry.toLowerCase().endsWith(".md"))
|
|
699
|
-
.map((entry) => path.join(absoluteDir, entry))
|
|
700
|
-
.sort((left, right) => left.localeCompare(right));
|
|
701
|
-
}
|
|
702
|
-
function resolveAbsolutePlanDirectory(dir, cwd, homeDir) {
|
|
703
|
-
if (dir.startsWith("~/")) {
|
|
704
|
-
return path.join(homeDir, dir.slice(2));
|
|
705
|
-
}
|
|
706
|
-
return path.isAbsolute(dir) ? dir : path.resolve(cwd, dir);
|
|
707
|
-
}
|
|
708
669
|
function normalizeAgentSelection(value) {
|
|
709
670
|
if (typeof value !== "string") {
|
|
710
671
|
return undefined;
|
|
@@ -712,13 +673,6 @@ function normalizeAgentSelection(value) {
|
|
|
712
673
|
const trimmed = value.trim();
|
|
713
674
|
return trimmed.length > 0 ? trimmed : undefined;
|
|
714
675
|
}
|
|
715
|
-
function isMissingDirectory(error) {
|
|
716
|
-
if (!error || typeof error !== "object" || !("code" in error)) {
|
|
717
|
-
return false;
|
|
718
|
-
}
|
|
719
|
-
const code = error.code;
|
|
720
|
-
return code === "ENOENT" || code === "ENOTDIR";
|
|
721
|
-
}
|
|
722
676
|
function createAgentRunner(options) {
|
|
723
677
|
return async (input) => {
|
|
724
678
|
const activeStage = options.activeStage();
|
|
@@ -998,15 +952,6 @@ function stripStopReason(result) {
|
|
|
998
952
|
maxReviewTurns: result.maxReviewTurns
|
|
999
953
|
};
|
|
1000
954
|
}
|
|
1001
|
-
function displayPath(filePath, cwd, homeDir) {
|
|
1002
|
-
if (filePath.startsWith(`${cwd}${path.sep}`)) {
|
|
1003
|
-
return path.relative(cwd, filePath);
|
|
1004
|
-
}
|
|
1005
|
-
if (filePath.startsWith(`${homeDir}${path.sep}`)) {
|
|
1006
|
-
return `~/${path.relative(homeDir, filePath)}`;
|
|
1007
|
-
}
|
|
1008
|
-
return filePath;
|
|
1009
|
-
}
|
|
1010
955
|
function createDefaultFs() {
|
|
1011
956
|
const fs = {
|
|
1012
957
|
readFile: fsPromises.readFile,
|