Instruction file imported from Youngv/WeChatClawBot (
.github/instructions/typescript-runtime.instructions.md). Copyright stays with the author.
TypeScript runtime instructions
- This codebase uses strict ESM TypeScript. Keep imports compatible with
moduleResolution: "NodeNext"and prefer explicit.jsextensions for local imports where needed. - Reuse existing modules before adding new directories or service layers.
- Preserve these architectural constraints:
- one long-running bot process
- background mode is managed by a repo-owned wrapper, not by turning the bot into multiple worker roles
- per-user Copilot session isolation
- environment-driven config in
src/config.ts - read-only Copilot permission policy by default
- Be careful with long-running async flows:
- startup
- background start/stop/status lifecycle
- signal handling
- message processing
- cleanup of temporary media files
- For changes under
src/config.ts, also update.env.exampleandREADME.md. - For code changes, validate with:
npm run typechecknpm run build
- Do not introduce fake validation steps, fake scripts, or references to tooling not present in
package.json.