chore: user-agnostic Claude identity and tests
- Use ~/Clawd instead of hardcoded /Users/steipete/clawd - Add MEDIA: syntax instructions to identity prefix - Update tests to check for 'scratchpad' instead of specific path 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
Peter Steinberger
parent
2fae0a9f47
commit
a86cb932cf
@@ -4,7 +4,7 @@ import { z } from "zod";
|
||||
// Preferred binary name for Claude CLI invocations.
|
||||
export const CLAUDE_BIN = "claude";
|
||||
export const CLAUDE_IDENTITY_PREFIX =
|
||||
"You are Clawd (Claude) running on the user's Mac via warelay. Your scratchpad is /Users/steipete/clawd; this is your folder and you can add what you like in markdown files and/or images. You don't need to be concise, but WhatsApp replies must stay under ~1500 characters. Media you can send: images ≤6MB, audio/video ≤16MB, documents ≤100MB. The prompt may include a media path and an optional Transcript: section—use them when present. If a prompt is a heartbeat poll and nothing needs attention, reply with exactly HEARTBEAT_OK and nothing else; for any alert, do not include HEARTBEAT_OK.";
|
||||
"You are Clawd (Claude) running on the user's Mac via warelay. Your scratchpad is ~/Clawd; this is your folder and you can add what you like in markdown files and/or images. You can send media by including MEDIA:/path/to/file.jpg on its own line (no spaces in path). Media limits: images ≤6MB, audio/video ≤16MB, documents ≤100MB. The prompt may include a media path and an optional Transcript: section—use them when present. If a prompt is a heartbeat poll and nothing needs attention, reply with exactly HEARTBEAT_OK and nothing else; for any alert, do not include HEARTBEAT_OK.";
|
||||
|
||||
function extractClaudeText(payload: unknown): string | undefined {
|
||||
// Best-effort walker to find the primary text field in Claude JSON outputs.
|
||||
|
||||
@@ -895,7 +895,7 @@ describe("config and templating", () => {
|
||||
const argv = runSpy.mock.calls[0][0];
|
||||
expect(argv[0]).toBe("claude");
|
||||
expect(argv.at(-1)).toContain("You are Clawd (Claude)");
|
||||
expect(argv.at(-1)).toContain("/Users/steipete/clawd");
|
||||
expect(argv.at(-1)).toContain("scratchpad");
|
||||
expect(argv.at(-1)).toMatch(/hi$/);
|
||||
// The helper should auto-add print and output format flags without disturbing the prompt position.
|
||||
expect(argv.includes("-p") || argv.includes("--print")).toBe(true);
|
||||
@@ -963,7 +963,7 @@ describe("config and templating", () => {
|
||||
expect(result?.text).toBe("Sure! What's up?");
|
||||
const argv = runSpy.mock.calls[0][0];
|
||||
expect(argv.at(-1)).toContain("You are Clawd (Claude)");
|
||||
expect(argv.at(-1)).toContain("/Users/steipete/clawd");
|
||||
expect(argv.at(-1)).toContain("scratchpad");
|
||||
});
|
||||
|
||||
it("serializes command auto-replies via the queue", async () => {
|
||||
|
||||
Reference in New Issue
Block a user