poe-code 3.0.94 → 3.0.96
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/SYSTEM_PROMPT.md +15 -0
- package/dist/cli/commands/spawn.js +21 -2
- package/dist/cli/commands/spawn.js.map +1 -1
- package/dist/cli/options.js +0 -11
- package/dist/cli/options.js.map +1 -1
- package/dist/cli/poe-agent-main.d.ts +3 -0
- package/dist/cli/poe-agent-main.js +142 -0
- package/dist/cli/poe-agent-main.js.map +1 -0
- package/dist/cli/program.js +6 -3
- package/dist/cli/program.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +29864 -30838
- package/dist/index.js.map +4 -4
- package/dist/providers/claude-code.js.map +2 -2
- package/dist/providers/codex.js.map +2 -2
- package/dist/providers/kimi.js.map +2 -2
- package/dist/providers/opencode.js.map +2 -2
- package/dist/providers/poe-agent.d.ts +3 -3
- package/dist/providers/poe-agent.js +5151 -3487
- package/dist/providers/poe-agent.js.map +4 -4
- package/dist/sdk/spawn.js +3 -22
- package/dist/sdk/spawn.js.map +1 -1
- package/dist/sdk/types.d.ts +2 -0
- package/dist/templates/pipeline/SKILL_plan.md +53 -0
- package/dist/templates/pipeline/steps.yaml.hbs +36 -0
- package/package.json +2 -1
- package/dist/cli/commands/ralph-worktree.d.ts +0 -3
- package/dist/cli/commands/ralph-worktree.js +0 -73
- package/dist/cli/commands/ralph-worktree.js.map +0 -1
- package/dist/cli/commands/ralph.d.ts +0 -3
- package/dist/cli/commands/ralph.js +0 -559
- package/dist/cli/commands/ralph.js.map +0 -1
package/dist/sdk/spawn.js
CHANGED
|
@@ -2,7 +2,6 @@ import { getPoeApiKey } from "./credentials.js";
|
|
|
2
2
|
import { spawnCore } from "./spawn-core.js";
|
|
3
3
|
import { createSdkContainer } from "./container.js";
|
|
4
4
|
import { getSpawnConfig, spawn as spawnNonStreaming, spawnInteractive, spawnStreaming, renderAcpStream } from "@poe-code/agent-spawn";
|
|
5
|
-
import { spawnPoeAgentWithAcp } from "../providers/poe-agent.js";
|
|
6
5
|
export function spawn(service, promptOrOptions, maybeOptions) {
|
|
7
6
|
const options = typeof promptOrOptions === "string"
|
|
8
7
|
? { ...maybeOptions, prompt: promptOrOptions }
|
|
@@ -50,6 +49,7 @@ export function spawn(service, promptOrOptions, maybeOptions) {
|
|
|
50
49
|
cwd: options.cwd,
|
|
51
50
|
model: options.model,
|
|
52
51
|
mode: options.mode,
|
|
52
|
+
signal: options.signal,
|
|
53
53
|
args: options.args,
|
|
54
54
|
...(options.mcpServers ? { mcpServers: options.mcpServers } : {})
|
|
55
55
|
});
|
|
@@ -59,27 +59,6 @@ export function spawn(service, promptOrOptions, maybeOptions) {
|
|
|
59
59
|
exitCode: interactiveResult.exitCode
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
if (service === "poe-agent") {
|
|
63
|
-
const poeBaseUrl = typeof process.env.POE_BASE_URL === "string"
|
|
64
|
-
? process.env.POE_BASE_URL.trim() || undefined
|
|
65
|
-
: undefined;
|
|
66
|
-
const { events: innerEvents, done } = spawnPoeAgentWithAcp({
|
|
67
|
-
prompt: options.prompt,
|
|
68
|
-
cwd: options.cwd,
|
|
69
|
-
model: options.model,
|
|
70
|
-
...(poeBaseUrl ? { baseUrl: poeBaseUrl } : {}),
|
|
71
|
-
...(options.mcpServers ? { mcpServers: options.mcpServers } : {})
|
|
72
|
-
});
|
|
73
|
-
resolveEventsOnce(innerEvents);
|
|
74
|
-
const final = await done;
|
|
75
|
-
return {
|
|
76
|
-
stdout: final.stdout,
|
|
77
|
-
stderr: final.stderr,
|
|
78
|
-
exitCode: final.exitCode,
|
|
79
|
-
threadId: final.threadId,
|
|
80
|
-
sessionId: final.sessionId ?? final.threadId
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
62
|
const spawnConfig = getSpawnConfig(service);
|
|
84
63
|
const supportsStreaming = !!spawnConfig &&
|
|
85
64
|
spawnConfig.kind === "cli" &&
|
|
@@ -92,6 +71,7 @@ export function spawn(service, promptOrOptions, maybeOptions) {
|
|
|
92
71
|
model: options.model,
|
|
93
72
|
mode: options.mode,
|
|
94
73
|
args: options.args,
|
|
74
|
+
signal: options.signal,
|
|
95
75
|
...(options.mcpServers ? { mcpServers: options.mcpServers } : {}),
|
|
96
76
|
useStdin: false
|
|
97
77
|
});
|
|
@@ -113,6 +93,7 @@ export function spawn(service, promptOrOptions, maybeOptions) {
|
|
|
113
93
|
model: options.model,
|
|
114
94
|
mode: options.mode,
|
|
115
95
|
args: options.args,
|
|
96
|
+
signal: options.signal,
|
|
116
97
|
...(options.mcpServers ? { mcpServers: options.mcpServers } : {}),
|
|
117
98
|
useStdin: false
|
|
118
99
|
});
|
package/dist/sdk/spawn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../../src/sdk/spawn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,cAAc,EACd,KAAK,IAAI,iBAAiB,EAC1B,gBAAgB,EAChB,cAAc,EACd,eAAe,EAEhB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../../src/sdk/spawn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,cAAc,EACd,KAAK,IAAI,iBAAiB,EAC1B,gBAAgB,EAChB,cAAc,EACd,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AAiC/B,MAAM,UAAU,KAAK,CACnB,OAAe,E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BACjE,QAAQ,EAAE,KAAK;aAChB,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,iBAAiB,CAAC,WAAW,CAAC,CAAC;YAC/B,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;IAEL,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;GAUG;AACH,KAAK,CAAC,MAAM,GAAG,KAAK,UAAU,MAAM,CAClC,OAAe,EACf,eAAsC,EACtC,YAA2C;IAE3C,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,EAAE,eAAyB,EAAE,YAAY,CAAC,CAAC;IACnF,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAC9B,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
package/dist/sdk/types.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export interface SpawnOptions {
|
|
|
17
17
|
mcpServers?: McpSpawnConfig;
|
|
18
18
|
/** Launch the agent in interactive (TUI) mode with inherited stdio */
|
|
19
19
|
interactive?: boolean;
|
|
20
|
+
/** Abort signal used to terminate the spawned agent */
|
|
21
|
+
signal?: AbortSignal;
|
|
20
22
|
}
|
|
21
23
|
/**
|
|
22
24
|
* Result from spawning a provider CLI.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: poe-code-pipeline-plan
|
|
3
|
+
description: 'Generate a Pipeline plan (YAML) from a user request. Triggers on: create a pipeline plan, write plan for, plan this feature, pipeline plan.'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## If The Request Is Empty
|
|
7
|
+
|
|
8
|
+
Ask the user for a one-sentence description of what they want to build.
|
|
9
|
+
|
|
10
|
+
## Goal
|
|
11
|
+
|
|
12
|
+
Write a YAML pipeline plan for `.poe-code/pipeline/plans/plan-<name>.yaml`
|
|
13
|
+
|
|
14
|
+
## Rules
|
|
15
|
+
|
|
16
|
+
- Each task must be self-contained. Put all context needed to execute the task inside that task's `prompt`.
|
|
17
|
+
- Do not create tasks that depend on hidden state from previous tasks.
|
|
18
|
+
- Use short kebab-case ids.
|
|
19
|
+
- Keep titles concise and descriptive.
|
|
20
|
+
- The available steps come from `.poe-code/pipeline/steps.yaml`, and that file is meant to be edited by the user. Use the current step names instead of inventing hardcoded ones.
|
|
21
|
+
- If no step configuration is present, use stepless tasks with scalar `status: open`.
|
|
22
|
+
- If step configuration is present, start every configured step status at `open`.
|
|
23
|
+
|
|
24
|
+
## Output Format
|
|
25
|
+
|
|
26
|
+
Stepless tasks:
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
tasks:
|
|
30
|
+
- id: auth-hardening
|
|
31
|
+
title: Harden auth flow
|
|
32
|
+
prompt: |
|
|
33
|
+
Improve auth validation and session handling.
|
|
34
|
+
status: open
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Stepped tasks when `.poe-code/pipeline/steps.yaml` defines steps:
|
|
38
|
+
|
|
39
|
+
```yaml
|
|
40
|
+
tasks:
|
|
41
|
+
- id: auth-hardening
|
|
42
|
+
title: Harden auth flow
|
|
43
|
+
prompt: |
|
|
44
|
+
Improve auth validation and session handling.
|
|
45
|
+
status:
|
|
46
|
+
implement: open
|
|
47
|
+
test: open
|
|
48
|
+
review: open
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Notes
|
|
52
|
+
|
|
53
|
+
- If the repository already has `.poe-code/pipeline/steps.yaml`, match its uncommented step names and order.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Edit this file to define Pipeline steps.
|
|
2
|
+
# Leave it comment-only to keep the default no-step behavior.
|
|
3
|
+
# Uncomment and change the example below when you want stepped tasks.
|
|
4
|
+
# Add `mode` only when you want to override the default `yolo`.
|
|
5
|
+
#
|
|
6
|
+
# steps:
|
|
7
|
+
# implement:
|
|
8
|
+
# instruction: |
|
|
9
|
+
# {{id}}: {{title}}
|
|
10
|
+
#
|
|
11
|
+
# Implement
|
|
12
|
+
# {{prompt}}
|
|
13
|
+
#
|
|
14
|
+
# refactor:
|
|
15
|
+
# instruction: |
|
|
16
|
+
# {{id}}: {{title}}
|
|
17
|
+
# Original task:
|
|
18
|
+
# {{prompt}}
|
|
19
|
+
#
|
|
20
|
+
# Refactor and improve the code
|
|
21
|
+
#
|
|
22
|
+
# test:
|
|
23
|
+
# instruction: |
|
|
24
|
+
# {{id}}: {{title}}
|
|
25
|
+
# Original task:
|
|
26
|
+
# {{prompt}}
|
|
27
|
+
#
|
|
28
|
+
# Be a user and test all edge cases, fix bugs
|
|
29
|
+
#
|
|
30
|
+
# commit:
|
|
31
|
+
# instruction: |
|
|
32
|
+
# {{id}}: {{title}}
|
|
33
|
+
# Original task:
|
|
34
|
+
# {{prompt}}
|
|
35
|
+
#
|
|
36
|
+
# Commit changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "poe-code",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.96",
|
|
4
4
|
"description": "CLI tool to configure Poe API for developer workflows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"poe-claude": "dist/bin/poe-claude.js",
|
|
59
59
|
"poe-codex": "dist/bin/poe-codex.js",
|
|
60
60
|
"poe-opencode": "dist/bin/poe-opencode.js",
|
|
61
|
+
"poe-agent": "dist/bin/poe-agent.js",
|
|
61
62
|
"tiny-stdio-mcp-test-server": "packages/tiny-stdio-mcp-test-server/dist/cli.js"
|
|
62
63
|
},
|
|
63
64
|
"files": [
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { execSync } from "node:child_process";
|
|
3
|
-
import { log } from "@poe-code/design-system";
|
|
4
|
-
import { listWorktrees, updateWorktreeStatus } from "@poe-code/worktree";
|
|
5
|
-
import { spawnInteractive } from "@poe-code/agent-spawn";
|
|
6
|
-
import { renderTemplate } from "@poe-code/config-mutations";
|
|
7
|
-
import { ValidationError } from "../errors.js";
|
|
8
|
-
export function registerRalphWorktreeCommand(ralph, container) {
|
|
9
|
-
ralph
|
|
10
|
-
.command("worktree")
|
|
11
|
-
.description("Merge a completed worktree back into the main branch.")
|
|
12
|
-
.argument("<name>", "Name of the worktree to merge")
|
|
13
|
-
.option("--agent <name>", "Agent to use for the merge")
|
|
14
|
-
.action(async function (name) {
|
|
15
|
-
const cwd = container.env.cwd;
|
|
16
|
-
const registryFile = path.join(cwd, ".poe-code-ralph", "worktrees.yaml");
|
|
17
|
-
const worktrees = await listWorktrees(cwd, registryFile, {
|
|
18
|
-
fs: {
|
|
19
|
-
readFile: (p, enc) => container.fs.readFile(p, enc),
|
|
20
|
-
writeFile: (p, data, opts) => container.fs.writeFile(p, data, opts),
|
|
21
|
-
mkdir: (p, opts) => container.fs.mkdir(p, opts)
|
|
22
|
-
},
|
|
23
|
-
exec: (command, opts) => Promise.resolve({
|
|
24
|
-
stdout: execSync(command, {
|
|
25
|
-
cwd: opts?.cwd,
|
|
26
|
-
encoding: "utf8",
|
|
27
|
-
stdio: ["ignore", "pipe", "pipe"]
|
|
28
|
-
}),
|
|
29
|
-
stderr: ""
|
|
30
|
-
})
|
|
31
|
-
});
|
|
32
|
-
const entry = worktrees.find((w) => w.name === name);
|
|
33
|
-
if (!entry) {
|
|
34
|
-
throw new ValidationError(`Worktree "${name}" not found in registry.`);
|
|
35
|
-
}
|
|
36
|
-
if (entry.status !== "done" && entry.status !== "failed") {
|
|
37
|
-
throw new ValidationError(`Worktree "${name}" has status "${entry.status}" and is not mergeable. Only "done" or "failed" worktrees can be merged.`);
|
|
38
|
-
}
|
|
39
|
-
if (!entry.gitExists) {
|
|
40
|
-
throw new ValidationError(`Worktree directory does not exist for "${name}". It may have been manually removed.`);
|
|
41
|
-
}
|
|
42
|
-
const options = this.opts();
|
|
43
|
-
const { default: mergeTemplate } = await import("../../templates/ralph/PROMPT_worktree_merge.md");
|
|
44
|
-
const renderedPrompt = renderTemplate(mergeTemplate, {
|
|
45
|
-
WORKTREE_NAME: entry.name,
|
|
46
|
-
WORKTREE_PATH: entry.path,
|
|
47
|
-
WORKTREE_BRANCH: entry.branch,
|
|
48
|
-
BASE_BRANCH: entry.baseBranch,
|
|
49
|
-
MAIN_CWD: cwd,
|
|
50
|
-
PLAN_PATH: entry.planPath ?? "",
|
|
51
|
-
STORY_ID: entry.storyId ?? ""
|
|
52
|
-
});
|
|
53
|
-
const agent = options.agent?.trim() || entry.agent;
|
|
54
|
-
const result = await spawnInteractive(agent, {
|
|
55
|
-
prompt: renderedPrompt,
|
|
56
|
-
cwd
|
|
57
|
-
});
|
|
58
|
-
const fsAdapter = {
|
|
59
|
-
readFile: (p, enc) => container.fs.readFile(p, enc),
|
|
60
|
-
writeFile: (p, data, opts) => container.fs.writeFile(p, data, opts),
|
|
61
|
-
mkdir: (p, opts) => container.fs.mkdir(p, opts)
|
|
62
|
-
};
|
|
63
|
-
if (result.exitCode === 0) {
|
|
64
|
-
await updateWorktreeStatus(registryFile, entry.name, "done", { fs: fsAdapter });
|
|
65
|
-
log.success(`Worktree "${entry.name}" merged successfully.`);
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
await updateWorktreeStatus(registryFile, entry.name, "failed", { fs: fsAdapter });
|
|
69
|
-
log.error(`Agent exited with code ${result.exitCode}. Worktree "${entry.name}" marked as failed.`);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=ralph-worktree.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ralph-worktree.js","sourceRoot":"","sources":["../../../src/cli/commands/ralph-worktree.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAA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