How microsoft/botframework-sdk works
Project type and purpose
• This is an open-source, cross-platform Bot Framework CLI tool and SDK repository. It provides a command-line interface (“bf” or “botframework-cli”) for working with conversational assets (LU files, QnA, orchestrator models, transcripts, telemetry), plus related schemas and specs.
High-level file-structure analysis
• Top level:
• Common/Telemetry & Transcripts – shared modules for recording and replaying conversation events
• Orchestrator – .NET-based NLU module plus samples, versioned model artifacts
• parsers/LU/JS – Node-based LU file parser packaged via Rush (monorepo)
• dri – Python scripts for Data Reporting & Insights (reads telemetry, outputs reports)
• schemas & specs – JSON schemas and markdown specs for validation and protocol definition
• tools/changelog – release automation
• Build/config: Rush config under parsers/LU/JS/common/config/rush; package.json files in each package; tsconfig/linters in JS packages.
Key components
a. CLI Host (Node.js process)
b. Command Plugins (dynamically loaded modules):
• LU Parser (JS package)
• QnA Maker parser (JS)
• Dispatch tool (JS)
• Orchestrator CLI (calls .NET binary or library)
• Transcripts module (JS/Python)
• Telemetry module (JS collects, Python dri reports)
c. Language/Runtimes:
• Node.js runtime for JS modules (Rush monorepo)
• .NET Core runtime for Orchestrator engine
• Python runtime for DRI scripts
d. Static assets:
• JSON Schemas (schemas/) used by “validate” commands
• Markdown Specs (specs/) for human-readable protocol definitions
Component interactions and data flow
• The user invokes the CLI host using a command (e.g., bf luis:parse, bf orchestrator:train, bf telemetry:report).
• The CLI uses a plugin-loader to dispatch the call to the appropriate module.
• Parser modules read conversational resource files (LU/QnA), produce JSON outputs.
• Orchestrator module submits/consumes trained model files (nlr_versions.json) via .NET library.
• Telemetry collector instruments commands and writes events to a telemetry store.
• DRI Python scripts read telemetry logs and generate HTML/JSON reports.
• Validation commands consume JSON Schemas from schemas/ to validate manifests or protocol messages.
Architectural patterns and principles
• Plugin-based modularity: each CLI command is a separate package under Rush, loaded at runtime by the host
• Polyglot micro-services: JS, .NET, and Python runtimes co‐exist in a single toolchain
• Separation of concerns: parsing, orchestration, telemetry, schema validation, and reporting each live in their own module
• Monorepo management: Yarn/Rush orchestrates versioning, building, and publishing of multiple packages
Essential elements
• Clear labels on each runtime boundary and module