Skip to content

LOU-U5, LOU-U6: README/docs accuracy and correct Node engines - #36

Merged
LinuxDevil merged 2 commits into
mainfrom
lou-u5-u6-docs-accuracy-engines
Oct 1, 2026
Merged

LinuxDevil merged 2 commits into
mainfrom
lou-u5-u6-docs-accuracy-engines

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

What

LOU-U5

  • scripts/verify-docs-snippets.ts now has two stages. Stage A type-checks every ts/typescript block in README.md and docs/*.md (24 blocks) against src/. Package export types entries are mapped from dist/ to src/ via tsconfig paths. Stage B is the existing packed-tarball type-check and run, still on quick-start only.
  • Partial snippets need no marker. Stage A prepends typed ambient placeholders (agent, provider, registry, storage, mcpClient, ...). A snippet's own declaration shadows them. ```ts no-verify is the opt-out. Both are documented at the top of the script.
  • Docs fixed: resumeAfterApproval examples (README, both) had provider and tool registry in the wrong order. The FlowBuilder example used nonexistent addNode/addEdge, so it is rewritten with setCode/setName/addInput/setFlow/build. Also fixed the MCP import path, the untyped trace exporter, a missing AgentExecutor import, a missing createAgent import, and the StorageService example.
  • docs:verify-snippets -- --skip-build added to CI after the build steps.
  • docs/eslint-baseline-followup.md refreshed: 0 errors, 428 warnings, summarized by rule and directory.

LOU-U6

  • engines.node changed from >=18.0.0 to >=22.19.0. Updated package-lock.json root entry, docs/installation.md, CONTRIBUTING.md and CI node-version (now 22.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: undici is imported only in src/tools/built-in/http.ts, but that module is reached eagerly from the package root, so import '@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-agent has no engines field and its template has none, so there was nothing to change there.

How verified

  • npx tsc --noEmit: clean
  • npm run lint: 0 errors, 428 warnings (none added)
  • both builds: success
  • npm run test:coverage: Test Files 85 passed; Tests 912 passed, 3 skipped
  • npm run fallow: exit 0
  • npm run docs:verify-snippets -- --skip-build: "all 24 snippet(s) type-check against src/; 5 also run cleanly"

Notes for reviewer

  • Found by the stricter check: real fs is not assignable to FileSystemAdapter (writeFileSync options type mismatch). The docs now cast. Follow-up: widen the adapter in code.
  • EditorStep types the editor shapes (step, condition, ...), but FlowExecutor runs other node types (llmCall, oneOf with options, ...). The README example casts with a comment. Follow-up: align the types.
  • Added .docs-snippets-*/ to .gitignore. Stage A uses a temp dir inside the repo so node_modules resolves; it is always removed.

🤖 Generated with Claude Code

LinuxDevil and others added 2 commits October 1, 2026 09:01
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>
@LinuxDevil
LinuxDevil merged commit a3a2e95 into main Oct 1, 2026
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.

1 participant