Repository navigation
LOU-U5, LOU-U6: README/docs accuracy and correct Node engines - #36
Merged
Merged
Conversation
LOU-U5: verify-docs-snippets now type-checks every ts block in README.md and docs/*.md against src/ (package exports mapped to source via tsconfig paths), with a typed ambient placeholder preamble for intentionally partial snippets and `no-verify` as the opt-out. Fixed what it flagged: README resumeAfterApproval examples had provider/toolRegistry swapped, the FlowBuilder example used nonexistent addNode/addEdge, plus wrong MCP import path, untyped exporter, a missing import, and a StorageService fs cast. Added the check to CI and refreshed docs/eslint-baseline-followup.md (0 errors, 428 warnings). LOU-U6: engines.node is now >=22.19.0 (undici@8, used by the built-in http tool and imported eagerly through the package root, crashes on Node 20). engines, installation docs, CONTRIBUTING and CI node-version agree. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…cy-engines # Conflicts: # .gitignore
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.
What
LOU-U5
scripts/verify-docs-snippets.tsnow has two stages. Stage A type-checks everyts/typescript block inREADME.mdanddocs/*.md(24 blocks) againstsrc/. Package exporttypesentries are mapped fromdist/tosrc/via tsconfigpaths. Stage B is the existing packed-tarball type-check and run, still on quick-start only.agent,provider,registry,storage,mcpClient, ...). A snippet's own declaration shadows them.```ts no-verifyis the opt-out. Both are documented at the top of the script.resumeAfterApprovalexamples (README, both) had provider and tool registry in the wrong order. TheFlowBuilderexample used nonexistentaddNode/addEdge, so it is rewritten withsetCode/setName/addInput/setFlow/build. Also fixed the MCP import path, the untyped trace exporter, a missingAgentExecutorimport, a missingcreateAgentimport, and theStorageServiceexample.docs:verify-snippets -- --skip-buildadded to CI after the build steps.docs/eslint-baseline-followup.mdrefreshed: 0 errors, 428 warnings, summarized by rule and directory.LOU-U6
engines.nodechanged from>=18.0.0to>=22.19.0. Updatedpackage-lock.jsonroot entry,docs/installation.md,CONTRIBUTING.mdand CInode-version(now22.19.0, the minimum).Why
Audit found docs examples that do not compile, and an engines range that lets Node 18/20 users install a package that crashes.
Engines decision:
undiciis imported only insrc/tools/built-in/http.ts, but that module is reached eagerly from the package root, soimport '@loushy/build-ai-agent'loads it. I did not lazy-load it, because that would add a runtime branch for a tool. I also could not truthfully claim Node 18/20 support without a test matrix for the rest of the SDK. So the range is the real minimum.packages/create-loushy-agenthas no engines field and its template has none, so there was nothing to change there.How verified
npx tsc --noEmit: cleannpm run lint: 0 errors, 428 warnings (none added)npm run test:coverage: Test Files 85 passed; Tests 912 passed, 3 skippednpm run fallow: exit 0npm run docs:verify-snippets -- --skip-build: "all 24 snippet(s) type-check against src/; 5 also run cleanly"Notes for reviewer
fsis not assignable toFileSystemAdapter(writeFileSyncoptions type mismatch). The docs now cast. Follow-up: widen the adapter in code.EditorSteptypes the editor shapes (step,condition, ...), butFlowExecutorruns other node types (llmCall,oneOfwithoptions, ...). The README example casts with a comment. Follow-up: align the types..docs-snippets-*/to.gitignore. Stage A uses a temp dir inside the repo sonode_modulesresolves; it is always removed.🤖 Generated with Claude Code