Add eve (Vercel framework) plugin#1864
Conversation
commit: |
| `{,agent/}{channels,connections,hooks,skills,tools,schedules}/**/*.${extensions}`, | ||
| `{,agent/}subagents/**/${agentFileNames}.${extensions}`, | ||
| `{,agent/}subagents/**/sandbox/sandbox.${extensions}`, | ||
| `{,agent/}subagents/**/{connections,hooks,skills,tools}/**/*.${extensions}`, |
There was a problem hiding this comment.
Subagent slots here are {connections,hooks,skills,tools}, but the root-level slots on line 19 also include channels and schedules. If Eve auto-discovers those inside subagents (e.g. agent/subagents/x/schedules/daily.ts or .../channels/slack.ts), they won't be marked as entries and will surface as false-positive unused files. If subagents genuinely can't own channels/schedules, could you confirm that against Eve's project-layout docs? The asymmetry isn't obvious from the code alone.
There was a problem hiding this comment.
Done in jakeleventhal@56b27db. I confirmed Eve project-layout docs list channels and schedules as root-only, so the plugin keeps subagent slots limited to connections, hooks, skills, tools, and sandbox/instructions/agent files. The fixture now includes unsupported subagent channels/schedules files and asserts they remain reported as unused.
|
|
||
| const extensions = '{js,jsx,ts,tsx,mjs,cjs,mts,cts}'; | ||
|
|
||
| const agentFileNames = '{agent,instructions,instrumentation,sandbox}'; |
There was a problem hiding this comment.
instructions and instrumentation aren't in the slot list from the PR description, and no fixture covers either (instrumentation looks like it may have carried over from the Next plugin's rootOrSrc line). If they aren't real Eve-discovered filenames, these globs silently broaden the entry set and can mask genuinely-unused instructions.ts/instrumentation.ts files — the exact false-negative this plugin is meant to prevent. Could you confirm they're real Eve conventions, and add fixture coverage for the untested slots (skills, instructions, instrumentation, and the subagent variants) either way?
There was a problem hiding this comment.
Done in jakeleventhal@56b27db. Eve docs confirm instructions.ts and root instrumentation.ts are real conventions, with instrumentation root-only. I split root/subagent filename globs so subagent instrumentation no longer gets masked, and added fixture coverage for root skills/instructions/instrumentation plus subagent connections/hooks/instructions/sandbox/skills and unsupported subagent instrumentation.
|
You're on a roll Jake, much appreciated! |
|
🚀 This pull request is included in v6.25.0. See Release 6.25.0 for release notes. Using Knip in a commercial project? Please consider becoming a sponsor. |
What changed
Adds a Knip plugin for
eve, enabled when theevepackage is present. The plugin marks Eve's filesystem-discovered agent files as production entries, including root/flat agent layouts, authored runtime slots (tools,skills,channels,connections,hooks,schedules, sandbox files), and nested subagent slots.The fixture intentionally includes an unused
agent/lib/unused.tsfile so the test verifies the plugin does not glob every TypeScript file underagent/as an entry.Why
Eve discovers agent capabilities from the filesystem rather than from a central import registry. Without a Knip plugin, real Eve apps have to add broad project-level entry globs such as
agent/**/*.ts, which prevents Knip from reporting genuine unused helper files/exports under the agent tree.Validation
bun test test/plugins/eve.test.tspnpm build