पैकेज सूचकांक
ग्यारह npm पैकेज, हर एक क्या export करता है, और इनमें से कौन बिना किसी LLM के काम करते हैं।
Handbooks ग्यारह पैकेजों का monorepo है। इनमें से चार कभी किसी LLM को नहीं छूते और अपने आप में पूरी तरह उपयोगी हैं।
| पैकेज | भूमिका | LLM? | दस्तावेज़ |
|---|---|---|---|
@handbooks/core | डेटा मॉडल, zod schemas, config registry, utilities | ❌ | README |
@handbooks/analyzer | बहु-भाषी static call graph निष्कर्षण | ❌ | README |
@handbooks/llm | OpenAI-संगत client, cache, actor–critic, mock | ✅ | README |
@handbooks/pipeline | generation pipeline, phases 1–3 | ✅ | README |
@handbooks/renderer | Markdown, HTML, agent index, llms.txt | ❌ | README |
@handbooks/skill | SKILL पैकेजिंग, सत्यापन, drift hashes | ❌ | README |
@handbooks/planner | केवल पढ़ने वाला planning agent | ✅ | README |
@handbooks/patcher | Byte-सटीक apply, बैकअप, rollback | ❌ | README |
@handbooks/resync | वृद्धिशील roll-forward | ✅ | README |
@handbooks/studio | स्थानीय वेब UI | ✅ | README |
@handbooks/cli | handbook कमांड | — | README |
अकेले सबसे उपयोगी तीन
@handbooks/analyzer — 18 भाषाओं के लिए एक call graph
import { registerBuiltinAdapters, discoverAll, getAdapter, buildGraph } from '@handbooks/analyzer';
registerBuiltinAdapters();
const byLanguage = discoverAll('/path/to/repo');
const analyses = [];
for (const [lang, files] of Object.entries(byLanguage)) {
analyses.push(await getAdapter(lang).analyze(files, '/path/to/repo'));
}
const { graph, stats } = buildGraph(
{ functions: analyses.flatMap((a) => a.functions), edges: analyses.flatMap((a) => a.edges) },
{
sourceRoot: '/path/to/repo',
scannedFiles: Object.values(byLanguage).flat(),
language: 'multi',
defaultExt: '',
},
);कोई LLM नहीं, कोई नेटवर्क नहीं, कोई native संकलन नहीं।
@handbooks/patcher — किसी edit योजना को सुरक्षित लागू करें
import { applyPlan, rollback, parsePlan } from '@handbooks/patcher';
const problems = parsePlan(planText).problems; // lint a plan without applying it
const dry = applyPlan({ sourceRoot, plan: planText, dryRun: true });
if (dry.ok) {
const result = applyPlan({ sourceRoot, plan: planText });
// rollback(result.backupDir!, { expectedSourceRoot: sourceRoot })
}योजना का प्रारूप परिवर्तन लागू करना में दर्ज है। यह ज़रूरी
नहीं कि योजना @handbooks/planner से ही आई हो — आप उसे हाथ से भी लिख सकते हैं।
@handbooks/renderer — किसी भी HandbookModel को रेंडर करें
import { renderMarkdownHandbook, renderAgentSite, renderLlmsTxt } from '@handbooks/renderer';
renderMarkdownHandbook(model, 'out/');
renderAgentSite(model, 'out/agent');
renderLlmsTxt(model, 'out/');HandbookModel ही एकमात्र अनुबंध है। उसे जैसे चाहें भरें, और रेंडरिंग, skill पैकेजिंग और
planning — सब काम कर जाते हैं।
मुख्य exports एक नज़र में
// @handbooks/core — the vocabulary
CodeGraph · FunctionNode · CallEdge · AdapterCapabilities
FileCard · Skeleton · Assignment · Organization · Narration · RegisterEntry
HandbookModel · StageTree · coerceRole
resolveConfig · settingsFor · envName · scopedEnvName · loadConfigFile · applyEnvFiles
writeFileAtomic · readValidatedJson · pLimit · withRetry · withDirLock · sha256Hex
// @handbooks/analyzer — the parser
registerBuiltinAdapters · registerAdapter · getAdapter · availableLanguages
discoverAll · adapterForFile · buildGraph · writeGraphArtifacts · buildNavPack
// @handbooks/llm — the model seam
ChatClient · OpenAiChatClient · CachedChatClient · MockChatClient
resolveLlmEnv · llmConfigFromValues · actorCriticLoop · ROLE_PROMPTS
// @handbooks/pipeline — generation
generateHandbook · loadHandbookModel · runPhase1 · generateCards
synthesizeSkeleton · synthesizeWithDoctor · assignFiles · organizeStages
narrate · extractRegisters · classifyMembers · WorkDir
// @handbooks/renderer — presentation
renderMarkdownHandbook · renderHtmlSite · renderSinglePageHtml
renderAgentSite · renderLlmsTxt · HandbookView · stageMapMermaid
// @handbooks/skill — packaging
buildSkill · validateSkill
// @handbooks/planner — localization
runPlanner · handbookDirFromSkill · parseDeclarations · ReadOnlyTools
// @handbooks/patcher — execution
applyPlan · rollback · listBackups · parsePlan
// @handbooks/resync — roll-forward
resyncHandbook · loadCase · diffGraphs · detectCardDetail · loadCorrections
// @handbooks/studio — the UI
startStudio · createStudioServer · StateStore · JobRunnerस्थापना
pnpm add @handbooks/analyzer # or npm / yarnहर पैकेज केवल ESM है ("type": "module"), type declarations भेजता है, Node ≥ 20.11 माँगता
है, और MIT लाइसेंस वाला है। तीसरे पक्ष के संस्करण workspace catalog में एक ही बार पिन किए
गए हैं, इसलिए दो पैकेज कभी एक ही library के दो संस्करणों पर नहीं पहुँच सकते।