Repository navigation
refactor(utils): move Ink-bound helpers out of utils/ (utils split 1/6) - #2155
Conversation
Move tool-result-display, message-factory and message-queue.tsx to components/, streaming-bash-tool to hooks/chat-handler/conversation/ and inline-diff to tools/file-ops/. Callers that only use names message-queue.tsx re-exports from message-queue-core now import the core module directly, so they stop loading Ink to log. No logic changes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
No changeset foundThis PR does not add a changeset, so it will not appear in the changelog or trigger a release. If the change is user-facing, add one: pnpm changesetPick a bump (patch / minor / major) and write the changelog entry in our usual voice ("Added X... Thanks to @you. Closes #123."), then commit the generated If this PR is docs-only or a chore that needs no release note, you can ignore this — or run |
|
nc-review could not produce a verdict this run (agent exit |
1 similar comment
|
nc-review could not produce a verdict this run (agent exit |
…e#2155) Move tool-result-display, message-factory and message-queue.tsx to components/, streaming-bash-tool to hooks/chat-handler/conversation/ and inline-diff to tools/file-ops/. Callers that only use names message-queue.tsx re-exports from message-queue-core now import the core module directly, so they stop loading Ink to log. No logic changes. Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Conflicts with on-demand MCP discovery (Nano-Collective#1651, Nano-Collective#2052, Nano-Collective#2057): - tool-manager.ts: kept discovery, the catalog and outage recovery, with this branch's registration rule on every path. A name a built-in, custom or skill tool has is skipped from the catalog too, so load_tool_schema can't offer the MCP schema for it, and loadMcpTool won't claim it. Tools loaded on demand are tracked, so an outage or a disconnect removes them and never the built-in. - daemon/entry.ts, plain/initialize.ts: pass upstream's tune config and keep the skipped-tools warning. - Specs: kept both sides; setGlobalMessageQueue moved to @/components/message-queue (Nano-Collective#2155), and the custom-tools stand-in client now maps its tool, which initializeMCP reads.
First of a short series that splits
source/utils/(≈100 modules) by domain and then enforces layering. This PR moves the Ink/React modules out ofutils/. It only moves files and updates imports; no logic changes.Target layout (whole series)
Names follow directories that already exist. The only new top-level ones are
conversation/,input/andterminal/.components/message-factory.ts,message-queue.tsx,tool-result-display.tsxhooks/chat-handler/conversation/streaming-bash-tool.tsx, whose only caller istool-executor.tsxtools/file-ops/inline-diff.tsx(this PR), thenedit-recovery,literal-replace,line-endings,path-validators,programming-language-helperconversation/(+conversation/compaction/)--plain, ACP and subagents:prompt-builder,message-builder,message-capping,message-visibility,run-outcome,completion-note; compaction:auto-compact*,compression-backup,message-compression,llm-summariser,inline-overridestools/runtime/tool-approval*,tool-confirm-queue,tool-args-parser,tool-call-id,tool-cancellation,tool-validation,schema-validate,truncate-tool-result,read-tracker,question-queueutils/fs/atomic-write,exclusive-file-lock,write-unique-file,file-cache,derived-content,gitignore-loader,file-search,ripgrep-path,file-tree,file-type-detector,path-validation,path,load-md-dir,ensure-nanocoder-gitignore,glob-matchinput/components/composer/:placeholders,paste-*,atomic-deletion,prompt-processor,file-mention-handler,file-content-loader,resource-mention-handler,file-autocomplete,clipboard-imageterminal/terminal-*,newline-key,highlighter,text-wrapping,ansi-truncate,indentation-normalizer,shell-command-displayservices/checkpoint-utils,update-checker+installation-detector,notificationsutils/(what stays)logging/,shutdown/,error-formatter,message-queue-core,global-handler-slot,type-helpers,backoff,bounded-map,truncate-text,frontmatter,fuzzy-matching,shell-args,url-utils,package-version,process-tree,stream-collector,template-sections,token-calculator, ...utils/,types/andconfig/may not importcomponents/,hooks/,tools/,mcp/orsession/. Remaining violations are fixed, or allowlisted with a comment.Modules that find their own location at runtime (
prompt-builderreads../../source/app/prompts/sections,package-version,notifications,installation-detector) only move to directories at the same depth.This PR
utils/tool-result-display.tsx,utils/message-factory.ts,utils/message-queue.tsx→components/utils/streaming-bash-tool.tsx→hooks/chat-handler/conversation/utils/inline-diff.tsx→tools/file-ops/git mv, so history follows).message-queue.tsxonly re-exportsmessage-queue-coreand addssetGlobalMessageQueue, the Ink renderer. Every caller that used just the re-exported names (notify*,addToMessageQueue,setMessageQueueSink) now imports@/utils/message-queue-coredirectly. The functions are the same objects, so behaviour does not change, but services,lsp/,firewall/,plugins/,stats/,tools/tool-manager.tsand others no longer loadcomponents/message-box(Ink) just to log. OnlyApp.tsxand four specs still importcomponents/message-queue.utils/line.Testing
tsc --noEmit,biome checkon the changed files (import order re-sorted by biome only)knipandknip --production --include files: cleanconfig/no-ink-fast-paths.spec.ts🤖 Generated with Claude Code