* feat(i18n): key translation pairing records by heading section Replace the whole-file blob hashes in *.i18n.yaml with one entry per heading section that still holds language-specific content, keyed by the English heading-slug path. Blocks identical across the pair (generated table rows, code blocks, shared regions) stay out of the hash, so edits to different sections and identical regenerations merge with Git's default text merge, including on GitHub. Remove the dsh-translation-pairing merge driver, its resolver command and installer wiring; gen-translation-brief recovers last-confirmed text from commit history. Migrate all active records, archive the superseded Agent Note, and record the replayed conflict reduction in the new one. * test(i18n): refresh translation prompt snapshot for the terminology note * feat(i18n): exclude only code blocks and generated regions from pairing records Replace byte-equality masking with an explicit rule: a record hash skips fenced code blocks and BEGIN/END GENERATED regions, the two kinds of content the pairing gate already requires to be identical on both sides. Move generated data into regions written into both pages: gen-config-catalog renders both languages and the record with per-package regions labelled by code identifiers; gen-module-graph keeps its table in a region; gen-doc-graphs splices the event matrix regions into the Chinese page. Add a generic region splice beside the region grammar.
description, kind
| description | kind |
|---|---|
| Caller-relative lazy loading for CommonJS-compatible Host dependencies whose initialization is not needed during application startup. | package-library |
@deepseek-ai/dsh-lazy-require
English | 中文
Summary
dsh-lazy-require keeps a CommonJS-compatible Host dependency unloaded until its first real operation. Resolution remains relative to the consuming package, and one successful module value is reused for the rest of the process realm.
Table of Contents
- Use this package
- Understand the implementation
- Further Exploration
- Model Experience
- Known Limitations and Deferred Work
- Dev Note
Use this package
Pass the dependency's literal specifier and the caller's import.meta.url:
import { createLazyRequire } from '@deepseek-ai/dsh-lazy-require'
interface NativeModule { open(): void }
const requireNative = createLazyRequire<NativeModule>('native-package', import.meta.url)
Calling requireNative() loads the dependency once. A failed load is not cached.
Understand the implementation
Implementation internals — click to expand
The utility creates Node's require from the supplied caller URL and caches only a successful return value. The explicit caller URL preserves package-local dependency resolution after publication.
Source map
| File | Role |
|---|---|
src/index.ts |
Caller-relative loader and successful-result cache |
Further Exploration
- Utility package map — adjacent shared primitives.
- NPM release sequences — published dependency classification and first-use loading policy.
Model Experience
None, as this Host utility registers no model-facing behavior.
KV Cache effect
None.
Known Limitations and Deferred Work
- CommonJS-compatible dependencies only — ESM-only packages require an asynchronous factory owned by their caller.
- WebWorker packaging needs an explicit request — the static packer does not discover dependencies named only in
createLazyRequire()calls. A package used in a Preview image must keep the dependency reachable through a supported literal request until the packer recognizes this helper.
No runtime invariant companion is published because the loader holds no independently observable mutable relationship.
Dev Note
None.