Registry / communication / botbuilder-dialogs-adaptive-runtime-core

botbuilder-dialogs-adaptive-runtime-core

JSON →
library4.23.3-previewjsnpmunverified

The `botbuilder-dialogs-adaptive-runtime-core` package provides the foundational, core components for building and running adaptive dialogs within the Microsoft Bot Framework SDK for JavaScript. As of version 4.23.3, it offers classes and interfaces like `ServiceCollection` and `Configuration` that enable dependency injection and configuration management for dynamic, context-aware conversational bots. It is a critical dependency for `botbuilder-dialogs-adaptive-runtime` and is part of a larger ecosystem designed to simplify bot development by allowing declarative dialog definitions and runtime adaptation to user input. The package is regularly updated with bug fixes, security patches, and support for newer Node.js and TypeScript versions. While this package provides the low-level building blocks, users typically interact with higher-level packages like `botbuilder-dialogs-adaptive-runtime` for complete bot runtime setup.

npm install botbuilder-dialogs-adaptive-runtime-core
INSTALL
IMPORT
SIG · BOTBUILDER-DIALOGS
B
botbuilder-dialogs-adaptive-runtime-core
communicationjavascriptv4.23.3-preview
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ServiceCollection
import { ServiceCollection } from 'botbuilder-dialogs-adaptive-runtime-core';
const ServiceCollection = require('botbuilder-dialogs-adaptive-runtime-core').ServiceCollection;
Primarily used for registering and resolving services within the adaptive runtime. ES Modules preferred.
Configuration
import { Configuration } from 'botbuilder-dialogs-adaptive-runtime-core';
An interface for obtaining configurable values, used for managing application settings. ES Modules preferred.
ConfigurationResourceExplorer
import { ConfigurationResourceExplorer } from 'botbuilder-dialogs-adaptive-runtime-core';
A class for accessing resource files based on configuration, essential for loading adaptive dialog assets. ES Modules preferred.

This quickstart initializes a basic bot using `botbuilder-dialogs-adaptive-runtime`'s `getRuntimeServices` to set up adaptive dialog capabilities, demonstrating how 'runtime-core' elements contribute to the bot's operation.

import { BotFrameworkAdapter, ActivityHandler } from 'botbuilder'; import { getRuntimeServices } from 'botbuilder-dialogs-adaptive-runtime'; import * as path from 'path'; import * as restify from 'restify'; // Basic bot implementation using the adaptive runtime. // This demonstrates how 'runtime-core' components are leveraged indirectly // through 'botbuilder-dialogs-adaptive-runtime' for a working bot. class AdaptiveBot extends ActivityHandler { private dialogManager: any; // In a real app, this would be DialogManager constructor(dialogManager: any) { super(); this.dialogManager = dialogManager; this.onMessage(async (context, next) => { console.log('Activity received:', context.activity.text); // This would trigger the adaptive dialog turn await this.dialogManager.onTurn(context); // By default, if no adaptive dialog handles the turn, echo the message. if (!context.responded) { await context.sendActivity(`You said: '${context.activity.text}'`); } await next(); }); this.onMembersAdded(async (context, next) => { const membersAdded = context.activity.membersAdded; for (const member of membersAdded) { if (member.id !== context.activity.recipient.id) { await context.sendActivity(`Hello and welcome!`); } } await next(); }); } } async function main() { const server = restify.createServer(); server.listen(process.env.port || process.env.PORT || 3978, function() { console.log(`\n${server.name} listening to ${server.url}`); console.log(`\nGet the Bot Framework Emulator: https://aka.ms/botframework-emulator`); console.log(`\nTo talk to your bot, open the emulator and connect to: http://localhost:${process.env.port || process.env.PORT || 3978}/api/messages`); }); // Retrieve runtime services using 'botbuilder-dialogs-adaptive-runtime' // which internally uses 'botbuilder-dialogs-adaptive-runtime-core' components. const [services, configuration] = await getRuntimeServices(path.resolve(__dirname, '..'), path.resolve(__dirname, '..', 'settings')); // The services object will contain various components, including the configured bot. const bot = services.get('bot'); if (!(bot instanceof ActivityHandler)) { throw new Error('Bot service must be an instance of ActivityHandler.'); } const adapter = new BotFrameworkAdapter({ appId: process.env.MicrosoftAppId ?? '', appPassword: process.env.MicrosoftAppPassword ?? '' }); server.post('/api/messages', (req, res) => { adapter.processActivity(req, res, async (context) => { await bot.run(context); }); }); } main().catch((err) => { console.error('Error starting bot:', err); process.exit(1); });
Debug
Known issues
breakingAs of Bot Framework JS SDK 4.23.0, Node.js versions prior to 18 are no longer supported. This is due to updates in underlying Azure Identity and MSAL.Node packages.
fix
Upgrade your Node.js environment to version 18 or higher. Node.js 22 is supported since 4.23.2.
affects: >=4.23.0
breakingAs of Bot Framework JS SDK 4.23.3, support for TypeScript 4.7 has been dropped due to incompatibilities with newer Node.js types. TypeScript 5.9 is now supported.
fix
Update your project's TypeScript version to 5.9 or newer.
affects: >=4.23.3
gotchaThe default `MemoryStorage` implementation, often used in examples, is designed for testing purposes with a single bot host and does not provide durable storage. Data will not persist across restarts or scale-out scenarios.
fix
For production environments or multi-instance deployments, configure a durable storage solution such as Azure Blob Storage or Cosmos DB via appropriate Bot Framework storage packages (e.g., `botbuilder-azure`).
affects: >=4.0
gotchaFederated Credentials for bot-to-channel authentication, introduced in Bot Framework JS SDK 4.23.2, are currently only supported for single-tenant applications.
fix
Ensure your application is configured for single-tenant if using Federated Credentials. For multi-tenant scenarios, alternative authentication methods might be required.
affects: >=4.23.2
deprecatedThe entire Microsoft Bot Framework SDK for JavaScript project is scheduled for archiving no later than the end of December 2025, with support tickets no longer being serviced as of December 31, 2025.
fix
Developers are advised to consider alternatives such as Microsoft Copilot Studio or migrate existing bots to the Agents SDK. Review migration guidance provided by Microsoft for existing Bot Framework SDK bots.
affects: >=4.0
Errors
Common errors & fixes
Error: Node.js version is not supported. Minimum supported version is 18.
Attempting to run the bot with an unsupported Node.js version (e.g., Node.js 16 or earlier).
fix
Upgrade your Node.js environment to version 18.x or higher using a version manager like `nvm` (e.g., `nvm install 18 && nvm use 18`).
TypeScript Error: This version of TypeScript is incompatible with the installed Node.js types. Expected >=5.9
Your project is using an older TypeScript version (e.g., 4.7) which is no longer compatible with the SDK's internal dependencies or type definitions.
fix
Update your TypeScript dependency in `package.json` to `^5.9.0` or newer, then run `npm install` or `yarn install` and rebuild your project.
Error: Bot service must be an instance of ActivityHandler.
The configured bot within the runtime services is not correctly set up as an `ActivityHandler`, or the `getRuntimeServices` function failed to initialize it properly based on configuration.
fix
Verify your `appsettings.json` or equivalent configuration to ensure the 'bot' entry correctly points to your bot's implementation that extends `ActivityHandler`. Check for configuration file parsing errors or missing declarative assets.
Upgrade
Version history
4.23.3-previewlatest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
43 hits · last 30 days
node
35
OpenAI (training)
1
Resources
botbuilder-dialogs-adaptive-runtime-core — npm install botbuilder-dialogs-adaptive-runtime-core · libregistry