@towles/tool 0.0.88 → 0.0.90
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/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { createInterface } from "node:readline";
|
|
2
|
+
import { join } from "node:path";
|
|
2
3
|
|
|
3
4
|
import consola from "consola";
|
|
4
5
|
import pc from "picocolors";
|
|
5
6
|
|
|
7
|
+
import { readFile } from "../../utils/fs.js";
|
|
6
8
|
import { getConfig } from "./config.js";
|
|
7
9
|
import { sleep } from "./shell.js";
|
|
8
10
|
import { spawnClaude as defaultSpawnClaude } from "./spawn-claude.js";
|
|
@@ -53,6 +55,20 @@ export async function runClaude(opts: {
|
|
|
53
55
|
|
|
54
56
|
log.info(`${pc.dim("▶")} Calling Claude${opts.maxTurns ? ` (max ${opts.maxTurns} turns)` : ""}…`);
|
|
55
57
|
|
|
58
|
+
try {
|
|
59
|
+
const systemPrompt = readFile(join(process.cwd(), "CLAUDE.md"));
|
|
60
|
+
log.info(
|
|
61
|
+
`\n${pc.bold(pc.cyan("── System Prompt (CLAUDE.md) ──"))}\n${pc.dim(systemPrompt.trimEnd())}\n`,
|
|
62
|
+
);
|
|
63
|
+
} catch { /* CLAUDE.md not present */ }
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
const promptContent = readFile(join(process.cwd(), opts.promptFile));
|
|
67
|
+
log.info(
|
|
68
|
+
`\n${pc.bold(pc.cyan(`── Prompt (${opts.promptFile}) ──`))}\n${pc.dim(promptContent.trimEnd())}\n`,
|
|
69
|
+
);
|
|
70
|
+
} catch { /* prompt file not present */ }
|
|
71
|
+
|
|
56
72
|
let lastError: Error | undefined;
|
|
57
73
|
for (let attempt = 1; attempt <= PROCESS_RETRIES; attempt++) {
|
|
58
74
|
try {
|