@cydm/pie 1.0.48 → 1.0.50
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 +1 -1
- package/dist/builtin/extensions/ask-user/index.js +2 -9
- package/dist/builtin/extensions/ask-user/package.json +0 -7
- package/dist/builtin/extensions/changelog/index.js +15 -20
- package/dist/builtin/extensions/document-attachments/index.js +0 -1
- package/dist/builtin/extensions/document-attachments/package.json +1 -1
- package/dist/builtin/extensions/init/index.js +0 -13
- package/dist/builtin/extensions/plan-mode/index.js +29 -17
- package/dist/builtin/extensions/subagent/index.js +15 -31
- package/dist/builtin/extensions/todo/index.js +4 -8
- package/dist/builtin/skills/skill-creator/SKILL.md +15 -43
- package/dist/builtin/skills/skill-creator/eval-viewer/generate_review.mjs +1 -1
- package/dist/builtin/skills/skill-creator/eval-viewer/viewer.html +2 -2
- package/dist/builtin/skills/skill-creator/references/schemas.md +1 -1
- package/dist/builtin/skills/skill-creator/scripts/generate_report.mjs +1 -1
- package/dist/builtin/skills/skill-creator/scripts/improve_description.mjs +3 -3
- package/dist/builtin/skills/skill-creator/scripts/pie_runner.mjs +32 -4
- package/dist/builtin/skills/skill-creator/scripts/run_loop.mjs +1 -1
- package/dist/chunks/{chunk-IJMP3JTX.js → chunk-DZS34ACX.js} +230 -46
- package/dist/chunks/{chunk-U4B6RJ6Z.js → chunk-XBWFDIAU.js} +1 -1
- package/dist/cli.js +127 -80
- package/package.json +3 -3
- package/dist/builtin/extensions/deploy/index.js +0 -11
- package/dist/builtin/extensions/deploy/package.json +0 -11
- package/dist/builtin/extensions/files/index.js +0 -10
- package/dist/builtin/extensions/files/package.json +0 -14
- package/dist/builtin/extensions/kimi-attachments/index.js +0 -47
- package/dist/builtin/extensions/kimi-attachments/package.json +0 -11
- package/dist/builtin/skills/skill-creator/scripts/claude_cli.mjs +0 -115
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { spawn, spawnSync } from "node:child_process";
|
|
4
|
-
import os from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
6
|
-
|
|
7
|
-
export function findProjectRoot(start = process.cwd()) {
|
|
8
|
-
const current = path.resolve(start);
|
|
9
|
-
let cursor = current;
|
|
10
|
-
while (true) {
|
|
11
|
-
if (path.basename(cursor) === ".claude" || existsDir(path.join(cursor, ".claude"))) {
|
|
12
|
-
return path.basename(cursor) === ".claude" ? path.dirname(cursor) : cursor;
|
|
13
|
-
}
|
|
14
|
-
const parent = path.dirname(cursor);
|
|
15
|
-
if (parent === cursor) {
|
|
16
|
-
return current;
|
|
17
|
-
}
|
|
18
|
-
cursor = parent;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function existsDir(dir) {
|
|
23
|
-
try {
|
|
24
|
-
return spawnSync("test", ["-d", dir]).status === 0;
|
|
25
|
-
} catch {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function buildClaudeEnv() {
|
|
31
|
-
const env = { ...process.env };
|
|
32
|
-
delete env.CLAUDECODE;
|
|
33
|
-
return env;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export async function callClaudeText(prompt, { model, timeout = 300_000 } = {}) {
|
|
37
|
-
const args = ["-p", "--output-format", "text"];
|
|
38
|
-
if (model) args.push("--model", model);
|
|
39
|
-
return runClaude(args, { stdin: prompt, timeout });
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function runClaudeStream(args, { cwd, timeout = 30_000 } = {}) {
|
|
43
|
-
const child = spawn("claude", args, {
|
|
44
|
-
cwd,
|
|
45
|
-
env: buildClaudeEnv(),
|
|
46
|
-
stdio: ["ignore", "pipe", "ignore"],
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const timer = setTimeout(() => {
|
|
50
|
-
child.kill("SIGKILL");
|
|
51
|
-
}, timeout);
|
|
52
|
-
|
|
53
|
-
child.once("exit", () => clearTimeout(timer));
|
|
54
|
-
child.once("error", () => clearTimeout(timer));
|
|
55
|
-
return child;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
async function runClaude(args, { stdin, timeout = 300_000, cwd } = {}) {
|
|
59
|
-
return new Promise((resolve, reject) => {
|
|
60
|
-
const child = spawn("claude", args, {
|
|
61
|
-
cwd,
|
|
62
|
-
env: buildClaudeEnv(),
|
|
63
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
let stdout = "";
|
|
67
|
-
let stderr = "";
|
|
68
|
-
|
|
69
|
-
const timer = setTimeout(() => {
|
|
70
|
-
child.kill("SIGKILL");
|
|
71
|
-
reject(new Error(`claude -p timed out after ${Math.round(timeout / 1000)}s`));
|
|
72
|
-
}, timeout);
|
|
73
|
-
|
|
74
|
-
child.stdout.on("data", (chunk) => {
|
|
75
|
-
stdout += String(chunk);
|
|
76
|
-
});
|
|
77
|
-
child.stderr.on("data", (chunk) => {
|
|
78
|
-
stderr += String(chunk);
|
|
79
|
-
});
|
|
80
|
-
child.on("error", (error) => {
|
|
81
|
-
clearTimeout(timer);
|
|
82
|
-
reject(error);
|
|
83
|
-
});
|
|
84
|
-
child.on("close", (code) => {
|
|
85
|
-
clearTimeout(timer);
|
|
86
|
-
if (code !== 0) {
|
|
87
|
-
reject(new Error(`claude -p exited ${code}\nstderr: ${stderr}`));
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
resolve(stdout);
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
if (stdin) {
|
|
94
|
-
child.stdin.write(stdin);
|
|
95
|
-
}
|
|
96
|
-
child.stdin.end();
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export function uuidFragment() {
|
|
101
|
-
return Math.random().toString(16).slice(2, 10) + Date.now().toString(16).slice(-4);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export function openInBrowser(target) {
|
|
105
|
-
const platform = os.platform();
|
|
106
|
-
if (platform === "darwin") {
|
|
107
|
-
spawn("open", [target], { detached: true, stdio: "ignore" }).unref();
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
if (platform === "win32") {
|
|
111
|
-
spawn("cmd", ["/c", "start", "", target], { detached: true, stdio: "ignore" }).unref();
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
spawn("xdg-open", [target], { detached: true, stdio: "ignore" }).unref();
|
|
115
|
-
}
|