chore: mainの内容をfor-businessに取り込む(Claude通知機能・TinyGo関連は除外)#77
Merged
Conversation
…ooks Add a Claude Code hook that surfaces assistant responses in Notification Center with the Claude for Desktop icon. Home-manager activation builds a minimal AppleScript .app (icon swapped from Claude.app, ad-hoc signed) so notifications appear from an app the notification system recognizes; a CC_INVOCATION sentinel guards against macOS spuriously re-launching the sender bundle with empty env.
Reading CC_INVOCATION via `system attribute` was flipping AppleScript into MacRoman text mode, mojibake-ing UTF-8 bodies read via later `do shell script` calls. Route the sentinel through `do shell script` too so the whole applet stays in one encoding. Log each hook fire to ~/.cache/claude-notify.log and drop the file when it crosses 1 MiB.
head -c 200 could split a multi-byte char, leaving invalid bytes that made AppleScript's do shell script fall back to MacRoman and mangle the entire notification body. Pipe through iconv -c to drop the incomplete tail; tolerate its non-zero exit under set -e.
Bumps [nix-darwin](https://github.com/nix-darwin/nix-darwin) from `56c666e` to `a1fa429`. - [Commits](nix-darwin/nix-darwin@56c666e...a1fa429) --- updated-dependencies: - dependency-name: nix-darwin dependency-version: a1fa429e945becaf60468600daf649be4ba0350c dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [homebrew-cask](https://github.com/homebrew/homebrew-cask) from `2a6d45e` to `5033334`. - [Release notes](https://github.com/homebrew/homebrew-cask/releases) - [Commits](Homebrew/homebrew-cask@2a6d45e...5033334) --- updated-dependencies: - dependency-name: homebrew-cask dependency-version: 5033334b5f70e65638d4a41c012181965da549c8 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [home-manager](https://github.com/nix-community/home-manager) from `4c5c1e8` to `a4d410d`. - [Commits](nix-community/home-manager@4c5c1e8...a4d410d) --- updated-dependencies: - dependency-name: home-manager dependency-version: a4d410db95a6416d1008049330bd86b85b5db45a dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [nix-homebrew](https://github.com/zhaofengli/nix-homebrew) from `aeb2069` to `de7953a`. - [Commits](zhaofengli/nix-homebrew@aeb2069...de7953a) --- updated-dependencies: - dependency-name: nix-homebrew dependency-version: de7953a08ed4bb9245be043e468561c17b89130d dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [homebrew-core](https://github.com/homebrew/homebrew-core) from `458fc34` to `b420e2d`. - [Commits](Homebrew/homebrew-core@458fc34...b420e2d) --- updated-dependencies: - dependency-name: homebrew-core dependency-version: b420e2d9ad6c2c1c9b3bb5e2f859e4608bc0cb82 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
Wrap gopls cmd with `env PATH=<direct-go-bin>:...` so gopls internal `go env` sees the TinyGo overlay GOROOT — the mise `go` shim silently overrides GOROOT env, which was masking `machine` package resolution. Also add `go.mod` to root_markers so tinygobook (no .git) is picked up as workspace root. For target switching, swap pcolladosoto/tinygo.nvim (monkey-patched to stop attached gopls) with sago35 さんの tinygo.vim (full GOROOT/GOOS/GOARCH/GOFLAGS support, actual client:stop on switch). Provide `:Tinygo <target>` wrapper that re-fires FileType after TinygoTarget so gopls re-attaches, and auto-detect `.tinygo.json` on FileType go to invoke it.
hooks block is reformatted by Claude Code on save (multi-line vs single-line) but content is unchanged.
sago35/tinygo.vim's `:TinygoTarget` already invokes
vim.lsp.enable('gopls', false) -> sleep 100m -> vim.lsp.enable('gopls', true)
on native LSP. From Neovim 0.11.2 onward, enable(false) calls client:stop()
and enable(true) fires doautoall('nvim.lsp.enable FileType'), so gopls
restarts and re-attaches to open buffers on its own — the extra FileType
re-fire in the `:Tinygo` wrapper is redundant.
Verified headless on the tinygobook (wioterminal target) with Neovim 0.12.3:
gopls attaches with the TinyGo overlay GOROOT + GOOS/GOARCH/GOFLAGS, and
`machine` resolves without the wrapper.
Claude-Session: https://claude.ai/code/session_01MpL4ZtCkUDDxdAGqEHUMUP
Follow-up to dropping the :Tinygo wrapper. The TinyGo autocmd is not gopls configuration — home/nvim/lua/lsp/ is a registry that lua/lsp/init.lua feeds to vim.lsp.config, so TinyGo tooling being there muddled the boundary. - Move vim.pack.add + FileType autocmd + apply cache to home/nvim/plugin/tinygo.lua (mirrors home/nvim/plugin/oplog.lua) - Use vim.fs.root(bufnr, marker) instead of vim.fs.dirname + vim.fs.find pair (matches home/nvim/lua/lsp/rust_ls.lua idiom, correctly handles unnamed buffers) - Read .tinygo.json with vim.fn.readfile instead of manual io.open dance - Drop tinygo.nvim from nvim-pack-lock.json (removed after prior commit) - Fix cosmetic missing space in M.filetypes Verified headless on tinygobook (wioterminal): gopls attaches with GOROOT/GOOS/GOARCH/GOFLAGS overlay, `machine` resolves. Claude-Session: https://claude.ai/code/session_01MpL4ZtCkUDDxdAGqEHUMUP
`tinygo.lua` alone doesn't convey what the file does; multiple things could be TinyGo-related. Rename to a verb-object form that names the responsibility: applying the target from `.tinygo.json` to the running gopls. Claude-Session: https://claude.ai/code/session_01MpL4ZtCkUDDxdAGqEHUMUP
Splitting the ~20 line TinyGo autocmd into plugin/apply-tinygo.lua added navigation cost without payoff — the autocmd exists to reconfigure gopls, and moving it away from the gopls spec made the relationship harder to see. Merge it back next to the M.cmd / M.settings it drives. Claude-Session: https://claude.ai/code/session_01MpL4ZtCkUDDxdAGqEHUMUP
pcall forwards args to its target, so pcall(vim.json.decode, str) is enough — no need for an inner closure. Fold config_path (used once) into the readfile call. Claude-Session: https://claude.ai/code/session_01MpL4ZtCkUDDxdAGqEHUMUP
d26e80a to
79942a2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
mainブランチの最新の変更をfor-businessに取り込みます。ただし Claude の macOS 通知機能と TinyGo 関連の変更は for-business では不要なため除外しています。取り込む変更
56c666etoa1fa429#70〜chore(deps): bump homebrew-core from458fc34tob420e2d#74)darwin-switchが必要になるケースの注記を追加effortLevelをxhigh→highに変更除外した変更
Claude 通知機能
home/claude/hooks/notify.sh/notify.applescript(新規追加分)home/claude/settings.jsonのhooks(Notification / Stop)home/home.nixのclaudeCodeNotifierアクティベーション、.claude/hookssymlink、専用のlib引数TinyGo 関連
home/nvim/lua/lsp/gopls.lua(tinygo.vim 連携・mise shim・自動:TinygoTarget)home/nvim/lua/lsp/init.lua(tinygo.nvim 関連の入れ替え)home/nvim/nvim-pack-lock.json(tinygo.vim 追加等)→ nvim 3ファイルは
for-businessの現状のまま据え置き(差分なし)。補足
nixfmt --checkと darwin ビルドの CI で検証されます。🤖 Generated with Claude Code
https://claude.ai/code/session_01KCpaDhdxg4hSRB3PWFnXXV