Registry /
communication / botbuilder-dialogs-adaptive-runtime-core
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
muslnode 18–226 runs
build_error
glibcnode 18–226 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);
});
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).
fixUpgrade 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.
fixUpdate 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.
fixVerify 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.