This guide provides instructions for building and developing the Microsoft Agent 365 Node.js SDK packages.
- Node.js: Version 18.0.0 or higher
- npm: Latest version recommended
- TypeScript: Installed globally or via workspace dependencies
The Microsoft Agent 365 Node.js SDK is organized as a monorepo with the following structure:
nodejs/
├── packages/ # Main SDK packages
│ ├── agents-a365-runtime/ # @microsoft/agents-a365-runtime
│ ├── agents-a365-notifications/ # @microsoft/agents-a365-notifications
│ ├── agents-a365-observability/ # @microsoft/agents-a365-observability
│ ├── agents-a365-tooling/ # @microsoft/agents-a365-tooling
│ ├── agents-a365-tooling-extensions-claude/ # @microsoft/agents-a365-tooling-extensions-claude
│ ├── agents-a365-tooling-extensions-langchain/ # @microsoft/agents-a365-tooling-extensions-langchain
│ └── agents-a365-tooling-extensions-openai/ # @microsoft/agents-a365-tooling-extensions-openai
├── samples/ # Sample applications
├── tests/ # Test suites
└── *.tgz # Built package files (generated)
Navigate to the nodejs directory and install all workspace dependencies:
cd nodejs
npm installThis command will:
- Install dependencies for all workspace packages
- Generate or update
package-lock.jsonfiles - Set up workspace linking between packages
Alternative - Production Install:
npm ciUse npm ci for faster, deterministic installs in CI/CD environments or when you want to install exactly what's in the lock file.
To build all SDK packages:
npm run buildTo generate distributable .tgz files:
cd packages
npm run packThis workflow will:
- First command: Compile TypeScript source code for all packages and generate JavaScript output in
dist/folders - Second command: Create
.tgzpackage files in thenodejs/directory - Make packages ready for distribution and installation in samples
Generated Package Files:
After building and packing, you'll find these .tgz files in the nodejs/ directory:
microsoft-agents-a365-runtime-{version}.tgzmicrosoft-agents-a365-notifications-{version}.tgzmicrosoft-agents-a365-observability-{version}.tgzmicrosoft-agents-a365-tooling-{version}.tgzmicrosoft-agents-a365-tooling-extensions-claude-{version}.tgzmicrosoft-agents-a365-tooling-extensions-langchain-{version}.tgzmicrosoft-agents-a365-tooling-extensions-openai-{version}.tgz
To remove build artifacts and start fresh:
npm run cleanThis command will:
- Remove all
dist/folders from workspace packages
To build a specific package, navigate to its directory and run:
cd packages/agents-a365-observability
npm run buildFor active development with automatic rebuilding:
cd packages/agents-a365-observability
npm run build:watchAfter building and packing packages with npm run build and npm pack --workspaces, you can install them in sample applications:
cd samples/claude-code-sdk
npm installThe sample package.json files reference the local .tgz files from the packages/ directory, so they'll use your locally built versions.
cd tests
npm install
npm testcd tests
npm run test:watchnpm run lintnpm run lint:fixThe following npm scripts are available at the workspace root (nodejs/):
| Script | Description |
|---|---|
npm run build |
Build all workspace packages |
npm run build:watch |
Build all packages in watch mode |
npm run clean |
Remove all build artifacts from packages |
npm run test |
Run tests for all packages |
npm run test:watch |
Run tests in watch mode |
npm run lint |
Run ESLint on all packages |
npm run lint:fix |
Fix ESLint issues in all packages |
npm run ci |
Run clean install on all packages |
If you encounter build errors:
-
Clean and reinstall:
npm install npm run clean npm run build
-
Check Node.js version:
node --version # Should be 18.0.0 or higher -
Clear npm cache:
npm cache clean --force
If samples can't find local packages:
- Ensure packages are built:
npm run build - Generate package files:
cd packages && npm pack --workspaces - Check that
.tgzfiles exist inpackages/directory - Verify sample
package.jsonreferences correct package versions
- Ensure all workspace dependencies are installed
- Check that TypeScript configuration is consistent across packages
- Verify that cross-package imports use correct module names
When ready to publish packages:
- Update version numbers in all
package.jsonfiles - Run full build and test suite:
npm run build && npm test - Generate packages:
cd packages && npm pack --workspaces - Publish individual packages to npm registry