refactor: rename hooks docs and add tests
This commit is contained in:
@@ -59,7 +59,7 @@ describe("onboard-hooks", () => {
|
||||
});
|
||||
|
||||
describe("setupInternalHooks", () => {
|
||||
it("should enable internal hooks when user selects them", async () => {
|
||||
it("should enable hooks when user selects them", async () => {
|
||||
const { buildWorkspaceHookStatus } = await import("../hooks/hooks-status.js");
|
||||
vi.mocked(buildWorkspaceHookStatus).mockReturnValue(createMockHookReport());
|
||||
|
||||
@@ -75,7 +75,7 @@ describe("onboard-hooks", () => {
|
||||
});
|
||||
expect(prompter.note).toHaveBeenCalledTimes(2);
|
||||
expect(prompter.multiselect).toHaveBeenCalledWith({
|
||||
message: "Enable internal hooks?",
|
||||
message: "Enable hooks?",
|
||||
options: [
|
||||
{ value: "__skip__", label: "Skip for now" },
|
||||
{
|
||||
@@ -173,8 +173,8 @@ describe("onboard-hooks", () => {
|
||||
const noteCalls = (prompter.note as ReturnType<typeof vi.fn>).mock.calls;
|
||||
expect(noteCalls).toHaveLength(2);
|
||||
|
||||
// First note should explain what internal hooks are
|
||||
expect(noteCalls[0][0]).toContain("Internal hooks");
|
||||
// First note should explain what hooks are
|
||||
expect(noteCalls[0][0]).toContain("Hooks let you automate actions");
|
||||
expect(noteCalls[0][0]).toContain("automate actions");
|
||||
|
||||
// Second note should confirm configuration
|
||||
|
||||
@@ -11,12 +11,12 @@ export async function setupInternalHooks(
|
||||
): Promise<ClawdbotConfig> {
|
||||
await prompter.note(
|
||||
[
|
||||
"Internal hooks let you automate actions when agent commands are issued.",
|
||||
"Hooks let you automate actions when agent commands are issued.",
|
||||
"Example: Save session context to memory when you issue /new.",
|
||||
"",
|
||||
"Learn more: https://docs.clawd.bot/internal-hooks",
|
||||
"Learn more: https://docs.clawd.bot/hooks",
|
||||
].join("\n"),
|
||||
"Internal Hooks",
|
||||
"Hooks",
|
||||
);
|
||||
|
||||
// Discover available hooks using the hook discovery system
|
||||
@@ -35,7 +35,7 @@ export async function setupInternalHooks(
|
||||
}
|
||||
|
||||
const toEnable = await prompter.multiselect({
|
||||
message: "Enable internal hooks?",
|
||||
message: "Enable hooks?",
|
||||
options: [
|
||||
{ value: "__skip__", label: "Skip for now" },
|
||||
...recommendedHooks.map((hook) => ({
|
||||
|
||||
Reference in New Issue
Block a user