LifeOSHooks/RichFormat types: setup names only claude-code.d.ts (claude-code-tools.d.ts also needed), mod-types skips when declarations are absent, RichFormat test fails tsc on 2.1.322

Đang mở
#2,778 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 5 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
58/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript

Hướng nghiên cứu

Start with LIFEOS/TOOLS/IntegrityCheck.ts and checkModTypes, then review the named setup docs and type declarations in skills/LifeOSHooks and skills/RichFormat. Reproduce the reported tsc failures on Claude Code 2.1.322 with the stated declaration files. Done when setup names both required files, mod-types detects installed mods missing declarations, and the RichFormat test typechecks.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

LifeOS 8.761.0, Claude Code 2.1.322, Linux. Both mods (LifeOSHooks, RichFormat) loaded from the skills folder.

1. Setup names one declaration file; the hooks module needs two

skills/LifeOSHooks/SKILL.md (§ After a Claude Code update), skills/LifeOSHooks/Setup.md and the mod-types fix text in LIFEOS/TOOLS/IntegrityCheck.ts name only claude-code.d.ts. With only that file in .claude/types/, tsc -p skills/LifeOSHooks reports 32 errors, all in hooks/LifeOSHooks.ts, for example:

  • TS2367: This comparison appears to be unintentional because the types '"Agent" | "AskUserQuestion" | "Glob" | ...' and '"Bash"' have no overlap (line 1270)
  • TS2339: Property 'command' does not exist on type 'never' (line 1373)

BuiltinToolInputs is empty until the engine's second file, claude-code-tools/index.d.ts, merges into it. Copying .claude-plugin/types/claude-code-tools/index.d.ts (which the engine lays beside the mod) to .claude/types/claude-code-tools.d.ts makes tsc exit 0 on 2.1.322.

Suggested fix: name both files wherever the declarations step is described. The engine's copies in .claude-plugin/types/ are also an easier source than the plugin-authoring skill folder; skills/RichFormat/Setup.md already points there.

2. mod-types reports "no function-hooks mods installed" when both are installed

checkModTypes recognises a mod by the presence of types/claude-code.d.ts or .claude/types/claude-code.d.ts. The release ships neither, so a fresh install shows ✓ mod-types skipped — no function-hooks mods installed while both mods are loaded, and the check that should flag declarations missing or stale for the running build never runs.

Suggested fix: find mods by hooks/hooks.json carrying modules (or by the plugin manifest), and report missing declarations as a non-blocking finding.

3. RichFormat tests/engine.test.tsx does not typecheck on 2.1.322

With both declaration files in skills/RichFormat/types/, tsc -p skills/RichFormat reports 4 × TS2345 at lines 38, 49, 63 and 89: Argument of type 'Engine' is not assignable to parameter of type '{ prompt: { compose: (e: unknown) => Promise<unknown>; }; }'. The helper interactive($: { prompt: { compose: (e: unknown) => Promise<unknown> } }, on) declares a parameter wider than PromptComposeInput, which strict function types reject. Typing $ as Engine (or compose: (e: never) => Promise<unknown>) clears it. hooks/ itself is clean.

Ngôn ngữ chính
TypeScript
Star
19.9k
Fork
2.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của danielmiessler/LifeOS

Tất cả issue của danielmiessler/LifeOS

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.