Skip to content

feat: webjs source <Export> prints one export's signature and doc - #1624

Merged
vivek7405 merged 4 commits into
mainfrom
feat/source-export
Oct 8, 2026
Merged

vivek7405 merged 4 commits into
mainfrom
feat/source-export

Conversation

@vivek7405

@vivek7405 vivek7405 commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1623

lookupExport() in @webjsdev/mcp returns one export's signature plus the doc comment above it from the installed @webjsdev/* packages: the typed declarations first (index.d.ts, src/*.d.ts), the authored JSDoc in src/ when no typed hit carries a doc, every overload, and a miss that names the searched packages. The MCP source tool takes it as export; webjs source <Export> [--pkg <name>] prints the same text for a Bash-only agent (exit 1 on a miss). Taught in the skill ("Full Documentation"), the scaffold AGENTS.md step 3, the root AGENTS.md CLI reference, packages/mcp/AGENTS.md and the docs configuration page.

Tests: packages/mcp/test/mcp-source.test.mjs (fake tree plus the real createAuth), test/cli/source.test.mjs, test/cli/help.test.mjs.

https://claude.ai/code/session_01SZ72LSPAo4NvYvBDSD6RLo

@vivek7405 vivek7405 self-assigned this Oct 7, 2026
@pilots-run

pilots-run Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Preview for a4d2efb was not built: compose file has unsupported keys

Next: fix the listed keys in the compose file

@vivek7405

Copy link
Copy Markdown
Collaborator Author

Benchmark, one warm-cache task-board build (same harness, model and credential as the $0.63 baseline; this branch alone):

baseline (webjscache_1) this PR (webjssource_1)
prefix on turn 1 65,486 cached 65,680 cached (the skill paragraph adds about 150 tokens)
turns 14 14
cost $0.629 $0.624
tokens 1.31M (1.24M cache read) 1.27M (1.20M cache read)
acceptance 19/19 first try 19/19 first try
looks tokens-only colors, dark mode, mobile, focus ring, hover the same (17 light-dark / prefers-color-scheme references in the layout, stat tiles, empty and error states)
the command not available used once, bunx webjs source signOut (30 lines back instead of a grep over server/src/auth.js plus a package listing)

Equal acceptance and looks, equal turns, cost within noise. Qualifies under the one-build gate. CI cannot run while the base is feat/context-pack (#1618); once that merges this PR retargets to main and scripts/ci-merge.sh 1624 merges it on green checks.

@vivek7405
vivek7405 marked this pull request as ready for review October 8, 2026 03:17
@vivek7405
vivek7405 force-pushed the feat/context-pack branch 2 times, most recently from f6e84db to be26980 Compare October 8, 2026 03:35
An agent that needs one framework contract today greps or prints whole
files under node_modules/@webjsdev/*. The unit it wants is one export:
its signature and the doc comment above it. lookupExport() in
@webjsdev/mcp finds the export in the installed packages' typed
declarations first (index.d.ts, src/*.d.ts), falls back to the authored
JSDoc in src/ when no typed hit carries a doc, prints every overload
and names the searched packages on a miss. The MCP source tool takes it
as `export`, and `webjs source <Export> [--pkg <name>]` prints the same
text for a Bash-only agent (exit 1 on a miss). The skill, the scaffold
AGENTS.md, the CLI reference and the docs site teach it; the source
stays the source of truth, this is the cheap first step.

Closes #1623

Claude-Session: https://claude.ai/code/session_01SZ72LSPAo4NvYvBDSD6RLo
@vivek7405
vivek7405 changed the base branch from feat/context-pack to main October 8, 2026 04:31
vivek7405 and others added 3 commits October 8, 2026 10:10
The hook's drift guard requires every CLI subcommand in its list, so the
new webjs source command failed the unit and Bun matrices.

Claude-Session: https://claude.ai/code/session_01SZ72LSPAo4NvYvBDSD6RLo
@vivek7405
vivek7405 merged commit 5ad3423 into main Oct 8, 2026
10 of 11 checks passed
@vivek7405
vivek7405 deleted the feat/source-export branch October 8, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an export lookup: webjs source <Export> and the MCP source export arg

1 participant