Commit Graph

11 Commits

Author SHA1 Message Date
Peter Steinberger d815c7caf8 fix(build): remove duplicate daemon-cli entry 2026-02-15 04:56:54 +00:00
Peter Steinberger fa1aca83ef fix(build): add daemon-cli bundle for legacy shim 2026-02-15 04:55:30 +00:00
Peter Steinberger 960850445b fix(build): restore daemon-cli legacy shim 2026-02-15 04:52:55 +00:00
Peter Steinberger 6543ce717c perf(test): avoid plugin-sdk barrel imports 2026-02-14 12:42:19 +00:00
Patrick Shao 5ac1be9cb6
fix: all bundled hooks broken since 2026.2.2 (tsdown migration) (#9295)
* fix: compile bundled hook handlers in tsdown build

The migration from tsc to tsdown in 2026.2.2 dropped bundled hook handlers
from the build output. The copy-hook-metadata.ts script only copies HOOK.md
metadata files, not the handler.ts source files. Without corresponding tsdown
entry points, the handlers were never compiled to JS, causing
`openclaw hooks list` to show 0 hooks on npm installs.

This adds each bundled hook handler and the llm-slug-generator (dynamically
imported by session-memory) as tsdown entry points:

  - src/hooks/bundled/session-memory/handler.ts
  - src/hooks/bundled/command-logger/handler.ts
  - src/hooks/bundled/boot-md/handler.ts
  - src/hooks/bundled/soul-evil/handler.ts
  - src/hooks/llm-slug-generator.ts

Regression introduced in 2026.2.2; versions 2026.1.29–2026.2.1 worked
correctly under the previous tsc build.

* refactor: use glob for bundled hook entries, fix dist output paths

- Replace hardcoded entry list with glob pattern in tsdown.config.ts
  so new hooks are auto-discovered (matching scripts/copy-hook-metadata.ts)
- Remove inconsistent comment block from tsdown.config.ts
- Fix copy-hook-metadata.ts to copy HOOK.md to dist/bundled/ (matching
  the runtime resolution in bundled-dir.ts which resolves path.join(moduleDir, 'bundled')
  relative to the chunk in dist/)
- Update stale path comment in session-memory handler
2026-02-09 11:35:47 +09:00
Gustavo Madeira Santana 3119057161 chore: centralizing warning filters 2026-02-08 05:18:08 -05:00
Peter Steinberger a3b5f1b15c fix(build): unblock pnpm build dts 2026-02-06 18:43:11 -08:00
cpojer 425003417d
fix: Remove `tsconfig.oxlint.json` AGAIN. 2026-02-03 21:53:48 +09:00
cpojer a03d852d65
chore: Migrate to tsdown, speed up JS bundling by ~10x (thanks @hyf0).
The previous migration to tsdown was reverted because it caused a ~20x slowdown when running OpenClaw from the repo. @hyf0 investigated and found that simply renaming the `dist` folder also caused the same slowdown. It turns out the Plugin script loader has a bunch of voodoo vibe logic to determine if it should load files from source and compile them, or if it should load them from dist. When building with tsdown, the filesystem layout is different (bundled), and so some files weren't in the right location, and the Plugin script loader decided to compile source files from scratch using Jiti.

The new implementation uses tsdown to embed `NODE_ENV: 'production'`, which we now use to determine if we are running OpenClaw from a "production environmen" (ie. from dist). This removes the slop in favor of a deterministic toggle, and doesn't rely on directory names or similar.

There is some code reaching into `dist` to load specific modules, primarily in the voice-call extension, which I simplified into loading an "officially" exported `extensionAPI.js` file. With tsdown, entry points need to be explicitly configured, so we should be able to avoid sloppy code reaching into internals from now on. This might break some existing users, but if it does, it's because they were using "private" APIs.
2026-02-03 20:18:16 +09:00
cpojer 76361ae3ab
revert: Switch back to `tsc` for compiling. 2026-01-31 18:31:49 +09:00
cpojer 68ba1afb34
fix: Fix `scripts/watch-node.mjs` and use `tsdown --watch`. 2026-01-31 17:55:49 +09:00