fix: expand reply cwd (~) and document AGENTS

This commit is contained in:
Peter Steinberger
2025-12-14 02:59:31 +00:00
parent 5ace7c9c66
commit 507f5623f4
8 changed files with 105 additions and 7 deletions

View File

@@ -9,6 +9,7 @@ import {
jidToE164,
normalizeE164,
normalizePath,
resolveUserPath,
sleep,
toWhatsappJid,
withWhatsAppPrefix,
@@ -85,3 +86,19 @@ describe("jidToE164", () => {
spy.mockRestore();
});
});
describe("resolveUserPath", () => {
it("expands ~ to home dir", () => {
expect(resolveUserPath("~")).toBe(path.resolve(os.homedir()));
});
it("expands ~/ to home dir", () => {
expect(resolveUserPath("~/clawd")).toBe(
path.resolve(os.homedir(), "clawd"),
);
});
it("resolves relative paths", () => {
expect(resolveUserPath("tmp/dir")).toBe(path.resolve("tmp/dir"));
});
});