feat(commands): add /commands slash list

This commit is contained in:
LK
2026-01-08 16:02:54 +01:00
parent c20a12aa7b
commit 559e175b38
7 changed files with 81 additions and 2 deletions
+14 -1
View File
@@ -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.",
);
});
});