Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nemoclaw-blueprint/policies/presets/whatsapp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
preset:
name: whatsapp
description: WhatsApp Web WebSocket and media access
description: "WhatsApp Web WebSocket and media access"
network_policies:
whatsapp:
name: whatsapp
Expand Down
2 changes: 1 addition & 1 deletion src/lib/policy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function listPresets(): PresetInfo[] {
.map((f: string) => {
const content = fs.readFileSync(path.join(PRESETS_DIR, f), "utf-8");
const nameMatch = content.match(/^\s*name:\s*(.+)$/m);
const descMatch = content.match(/^\s*description:\s*"?([^"]*)"?$/m);
const descMatch = content.match(/^\s*description:\s*"?([^\n"]*)"?$/m);
return {
file: f,
name: nameMatch ? nameMatch[1].trim() : f.replace(".yaml", ""),
Expand Down
6 changes: 6 additions & 0 deletions test/policies.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ describe("policies", () => {
}
});

it("does not include the WhatsApp preset YAML body in the description", () => {
const whatsapp = policies.listPresets().find((p) => p.name === "whatsapp");
expect(whatsapp?.description).toBe("WhatsApp Web WebSocket and media access");
expect(whatsapp?.description).not.toContain("network_policies:");
});

it("returns expected preset names", () => {
const names = policies
.listPresets()
Expand Down
Loading