mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 15:01:41 +03:00
feat(commands): add /commands slash list
This commit is contained in:
@@ -2,7 +2,7 @@ import fs from "node:fs";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { buildStatusMessage } from "./status.js";
|
||||
import { buildCommandsMessage, buildStatusMessage } from "./status.js";
|
||||
|
||||
const HOME_ENV_KEYS = ["HOME", "USERPROFILE", "HOMEDRIVE", "HOMEPATH"] as const;
|
||||
type HomeEnvSnapshot = Record<
|
||||
@@ -234,3 +234,16 @@ describe("buildStatusMessage", () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("buildCommandsMessage", () => {
|
||||
it("lists commands with aliases and text-only hints", () => {
|
||||
const text = buildCommandsMessage();
|
||||
expect(text).toContain("/commands - List all slash commands.");
|
||||
expect(text).toContain(
|
||||
"/think (aliases: /thinking, /t) - Set thinking level.",
|
||||
);
|
||||
expect(text).toContain(
|
||||
"/compact (text-only) - Compact the current session context.",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user