Skip to content

Bundled hooks handler.ts files missing from npm package #10198

@ChanDava

Description

@ChanDava

Problem

The bundled hooks (session-memory, command-logger, boot-md) have HOOK.md documentation files in dist/hooks/bundled/, but the corresponding handler.ts implementation files are missing from the npm package.

Current state

dist/hooks/bundled/ contains only HOOK.md files:

$ ls /opt/homebrew/lib/node_modules/openclaw/dist/hooks/bundled/session-memory/
HOOK.md

$ ls /opt/homebrew/lib/node_modules/openclaw/dist/hooks/bundled/command-logger/
HOOK.md

But handler.ts exists in the source code on GitHub:

src/hooks/bundled/session-memory/handler.ts
src/hooks/bundled/command-logger/handler.ts
src/hooks/bundled/boot-md/handler.ts

Symptom

openclaw hooks list shows "No hooks found" even though hooks are configured in openclaw.json:

$ openclaw hooks list
No hooks found.

Root Cause

The package.json files field does not include src/hooks/bundled/, so the source directory is not included in the npm package:

// package.json
{
  "files": [
    "assets/",
    "dist/",
    "docs/",
    "extensions/",
    ...
  ]
}

Additionally, dist/hooks/bundled/ only contains HOOK.md - the handler.ts files are never compiled to JavaScript in the dist directory.

Expected Behavior

Bundled hooks should work out of the box after npm install. Users should see:

$ openclaw hooks list
Hooks (3/3 ready)
┌──────────┬─────────────────────┬───────────────────────────────────────┐
│ Status   │ Hook                │ Description                           │
├──────────┼─────────────────────┼───────────────────────────────────────┤
│ ✓ ready  │ 🚀 boot-md           │ Run BOOT.md on gateway startup        │
│ ✓ ready  │ 📝 command-logger   │ Log all command events                │
│ ✓ ready  │ 💾 session-memory   │ Save session to memory on /new         │
└──────────┴─────────────────────┴───────────────────────────────────────┘

Suggested Fix

Option 1: Add src/hooks/bundled/ to package.json files field

Option 2: Update build script to compile handler.ts files to dist/hooks/bundled/

Environment

  • OpenClaw version: 2026.2.3-1
  • Installation: Homebrew (brew install openclaw/openclaw/openclaw)
  • OS: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions