* feat: add streamAggregated method to collect model streaming events - Add 'type: message' discriminator field to Message interface - Add streamAggregated() method to Model interface and BedrockModel - Add StreamAggregationError for stream validation failures - Pass through all original ModelStreamEvent events - Emit complete ContentBlock objects after contentBlockStop - Emit complete Message objects after messageStop - Support type-safe switch-case handling with discriminators - Add comprehensive unit tests (9 new tests, 73 total) - Add integration test for streamAggregated() - Update all Message fixtures to include type field - 99.24% test coverage maintained Resolves: #56 * refactor: move streamAggregated to model.ts and update ReasoningDelta structure - Move streamAggregated implementation from bedrock.ts to model.ts as aggregateStream helper function - Update ReasoningDelta type to nest properties under reasoningContent object - Update Bedrock event mapper to create nested reasoningContent structure - Replace if/else with switch statement for delta type handling - Use nullish coalescing operator (??) instead of logical OR (||) for text concatenation - Remove example documentation from bedrock.ts streamAggregated method - Remove end-of-stream validation checks as requested - Update test expectations to match new ReasoningDelta structure - Remove tests for removed validation checks (incomplete block/message) - All 71 unit tests passing * Rebase fixes --------- Co-authored-by: Strands Agent <217235299+strands-agent@users.noreply.github.com>
Strands Agents - TypeScript SDK
A model-driven approach to building AI agents in TypeScript/JavaScript.
Documentation ◆ Samples ◆ Python SDK ◆ Tools ◆ Agent Builder ◆ MCP Server
Strands Agents is a simple yet powerful SDK that takes a model-driven approach to building and running AI agents. The TypeScript SDK brings key features from the Python Strands framework to TypeScript environments, enabling agent development for both Node.js servers and web browsers.
Note
: This SDK is currently under active development. Features are being added incrementally. Check the project overview for the roadmap.
Feature Overview (Planned)
- Lightweight & Flexible: Simple agent loop that works seamlessly in Node.js and browsers
- Model Agnostic: Support for Amazon Bedrock, OpenAI, and custom model providers
- Tool System: Decorator-based tool definition with automatic registry management
Quick Start (Coming Soon)
Once the SDK is complete, usage will look something like this:
import { Agent } from '@strands-agents/sdk'
import { calculator } from '@strands-agents/tools'
const agent = new Agent({ tools: [calculator] })
const response = await agent.invoke('What is the square root of 1764?')
console.log(response)
Installation (Coming Soon)
Once published to npm:
npm install @strands-agents/sdk
For browser usage:
import { Agent } from '@strands-agents/sdk'
// Your agent code here
For Node.js usage:
import { Agent } from '@strands-agents/sdk'
// Your agent code here
Development Status
This TypeScript SDK is being developed with the following features (see project overview for details):
- ✅ Project Structure: TypeScript configuration, testing framework, development infrastructure
- 🚧 Model Providers: Amazon Bedrock, OpenAI, and custom provider support
- ✅ Tool System: Tool execution, registry, and decorator-based definitions
- 🚧 Agent Interface: Core agent class with
invokeandstreammethods - 🚧 Event Loop: Async iterator-based agent loop for orchestration
- 🚧 Conversation Manager: Context window overflow handling
- 🚧 Hooks System: Lifecycle event extensibility
- 🚧 Telemetry: OpenTelemetry-based observability
- 🚧 Metrics: Usage tracking and reporting
Documentation
For detailed guidance on the Strands Agents framework (Python-based examples):
TypeScript-specific documentation will be added as the SDK develops.
Contributing ❤️
We welcome contributions! See our Contributing Guide for details on:
- Development setup and environment
- Testing and code quality standards
- Pull request process
- Code of Conduct
- Security issue reporting
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Security
See CONTRIBUTING for more information on reporting security issues.