Skip to content

Commit 21f5378

Browse files
authored
Feat/0.5.6 (#15)
* Enhance project structure and update configurations - Added new project structure documentation in `project-structure.txt` for better clarity on the organization of the codebase. - Updated Jest configuration in `jest.config.js` to support module path aliases for improved import management. - Modified `tsconfig.json` to include the `src` directory for TypeScript compilation. - Updated `package.json` with new dependencies for TypeScript and TSX support. - Refactored service and transport layers to improve modularity and organization, including the introduction of new files in the `src/services` and `src/transport` directories. - Removed deprecated files and methods to streamline the codebase and enhance maintainability. - Updated tests to align with the new structure and validate functionality across the application. * Update package.json and tsconfig.json for TypeScript enhancements; refactor service methods for clarity - Added `ts-patch` dependency and a `prepare` script in `package.json` for TypeScript patching. - Updated `tsconfig.json` to include `typescript-transform-paths` for improved path handling. - Refactored service methods in `resubscribe-task.ts`, `send-message.ts`, and `stream-message.ts` to use `contextId` for better clarity. - Modified `index.ts` to remove deprecated exports and enhance module organization. - Introduced new tests for npm package installation and deployment functionalities to ensure robustness. * Add A2A EngineBuilder and related types for step management - Introduced `EngineBuilder` class to facilitate the creation and management of steps in the A2A protocol. - Added types for `textStep`, `fileStep`, and `dataStep` to define various step functionalities. - Implemented `createAgentExecutor` function to execute steps in order and handle task status updates. - Updated `index.ts` and related type definitions to include new builder functionalities. - Added comprehensive tests for the `AgentBuilder` to ensure correct step creation and execution. * Update CHANGELOG and README for version 0.5.6; refactor examples and services for new architecture - Added detailed entries in CHANGELOG for version 0.5.6, highlighting major architectural changes, new features, and breaking changes. - Updated README to reflect the new service-based architecture, including the introduction of `createAgentServer()` and enhanced agent utilities. - Refactored example implementations to align with the new architecture, demonstrating the use of `createAgentServer()` and improved agent logic. - Enhanced service methods and task management to support asynchronous state handling and improved modularity. - Updated tests to ensure compatibility with the new service-oriented design and validate functionality across the application. * Remove deprecated dependencies from package.json and enhance README with new event handling section. Updated SDK documentation to include comprehensive event monitoring capabilities and examples for better user guidance. * Refactor error handling in tests and remove outdated comments - Removed a TODO comment in `errors.ts` regarding moving functionality to the server. - Cleaned up comments in `server-impl.test.ts` and `server.test.ts` to enhance clarity and maintain consistency in error message expectations. * Update package.json to include new dependencies and enhance type safety in service methods - Added `escape-html` and its TypeScript types to improve HTML escaping in error handling. - Refactored parameter types in various service methods to use `unknown` for better type safety. - Updated error handling to utilize `escapeHtml` for sanitizing request IDs. - Improved code clarity by using `const` instead of `let` where applicable. * Enhance README and refactor A2A service components for improved clarity and functionality - Updated README to clarify the artinet SDK's purpose and usage, including version support for `create-quick-agent`. - Refactored A2A service components to improve modularity and organization, including the introduction of helper functions for message part extraction. - Enhanced type definitions and added comprehensive documentation for new A2A context and event management features. - Improved error handling and streamlined agent logic in quick server examples for better user guidance. - Updated tests to validate new functionalities and ensure compatibility with recent changes.
1 parent 4baa5b5 commit 21f5378

File tree

187 files changed

+9889
-21555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+9889
-21555
lines changed

CHANGELOG.md

Lines changed: 106 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,85 @@ All notable changes to the @artinet/sdk package will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.5.6] - 2025-01-25
9+
10+
### Added
11+
12+
- **New Service-Based Architecture**: Complete refactoring with dedicated service layer for better modularity and maintainability
13+
- `src/services/a2a/` - A2A protocol service implementation with factory pattern
14+
- `src/services/core/` - Core execution and management services
15+
- New `A2AServiceInterface` for standardized service contracts
16+
- **New Express Server Implementation**: Modern Express-based server replacing the legacy A2A server
17+
- `createAgentServer()` function for simplified server creation
18+
- Custom JSON-RPC middleware for Express (`jsonRPCMiddleware`)
19+
- Enhanced error handling with dedicated error middleware
20+
- Support for tRPC integration (commented example provided)
21+
- **Enhanced Type Organization**: Comprehensive type restructuring under `schemas/a2a/` directory using Zod
22+
- Authentication types (`auth/auth.ts`, `auth/oauth.ts`, etc.)
23+
- Enhanced message, task, and parameter schemas
24+
- New deployment-specific type definitions
25+
- **New Deployment Export Path**: Added `./deployment` export in package.json for deployment utilities
26+
- **Path Alias Support**: Added `~/` path alias for cleaner imports throughout the codebase
27+
- **New Core Managers**: Command, event, and stream managers for better resource management
28+
- **Enhanced Factory Pattern**: Builder pattern implementation for creating A2A services and agents
29+
30+
### Changed
31+
32+
- **BREAKING**: Updated package description from "TypeScript SDK for Agentic Communication" to "TypeScript SDK for the Agent2Agent (A2A) Protocol"
33+
- **BREAKING**: Major refactoring of server architecture - `A2AServer` is now removed in favor of the new Express-based `createAgentServer()`
34+
- **BREAKING**: Reorganized exports in main index - services now exported before utils
35+
- **BREAKING**: Updated Agent Card endpoint from `/.well-known/agent.json` to `/.well-known/agent-card.json`
36+
- Updated dependencies:
37+
- Added `@trpc/server: ^11.4.3` for tRPC integrations
38+
- Added `ts-patch: ^3.3.0` for TypeScript transformations
39+
- Added `typescript-transform-paths: ^3.5.5` for path transformation
40+
- Enhanced project structure with better separation of concerns
41+
- Improved JSON-RPC method handling with dedicated middleware
42+
- Enhanced error handling with more specific error types and better context
43+
44+
### Deprecated
45+
46+
- **`A2AServer` class**: The legacy A2A server implementation is deprecated. Use the new `createAgentServer()` function instead
47+
- Legacy server interfaces and parameter types in favor of the new service-based architecture
48+
49+
### Removed
50+
51+
- **Legacy Server Components**: Removed outdated server interfaces and implementations
52+
- `src/server/interfaces/params.ts`
53+
- `src/server/interfaces/server.ts`
54+
- `src/server/interfaces/store.ts`
55+
- Legacy Express server utilities
56+
- **Outdated Manager**: Removed `src/services/manager.ts` in favor of new core managers
57+
58+
### Improved
59+
60+
- **Development Experience**:
61+
- Added `prepare` script for automatic ts-patch installation
62+
- Added `rebuild` script for clean rebuilds
63+
- Enhanced Jest configuration with path mapping support
64+
- **Code Organization**: Better separation between client, server, services, and utilities
65+
- **Type Safety**: Enhanced type definitions with more specific interfaces and better error handling
66+
- **Modularity**: Service-based architecture allows for better testing and extensibility
67+
- **Documentation**: Added comprehensive project structure documentation
68+
69+
### Technical Notes
70+
71+
- This release represents a major architectural shift towards a service-oriented design
72+
- The new architecture provides better separation of concerns and improved testability
73+
- Legacy `A2AServer` has been removed developers should migrate to the new `createAgentServer()` approach
74+
- Enhanced support for different transport layers (Express, tRPC, WebSockets, etc.)
75+
- Improved factory patterns for creating and configuring A2A services and agents
76+
877
## [0.5.4] - 2025-06-12
978

1079
### Added
80+
1181
- New `ExecutionContext` interface for enhanced parameter management across services
1282
- `MCPExecutionContext` and `NLWebExecutionContext` interfaces for protocol-specific request handling
1383
- New schema organization under `schemas/a2a` directory for improved code structure
1484

1585
### Changed
86+
1687
- **BREAKING**: Renamed core methods to align with message-based approach:
1788
- `sendTask``sendMessage`
1889
- `sendTaskSubscribe``sendStreamingMessage`
@@ -22,50 +93,59 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2293
- Updated documentation to reflect new method names and functionalities
2394

2495
### Removed
96+
2597
- Deprecated submodules for `a2a-samples` and `mcp-use`
2698

2799
## [0.5.2] - 2025-05-25
28100

29101
### Added
102+
30103
- New `artinet.v0` namespace in `src/utils/deployment/agents.ts` providing `taskManager`, `connect`, and `agent` utilities. These are designed for agents running in sandboxed or managed environments, offering a standardized way to interact with the host system for task execution, inter-agent communication, and external API calls.
31104
- Corresponding types for the new agent utilities in `src/types/proxy.ts`: `TaskProxy`, `TaskManagerProps`, `TaskManager`, `ConnectProps`, `ConnectAPICallback`, `ClientProxy`, `ClientProps`, `ClientFactory`.
32105
- New `exports` path `./agents` in `package.json` to expose the `artinet.v0` utilities.
33106
- New example file `examples/nested-deployment.ts` demonstrating how to use `artinet.v0.agent` for an agent to call another agent, and `artinet.v0.taskManager` for managing the agent's lifecycle.
34107
- New `dev-pack` script in `package.json` for easier local development and packaging.
35108

36109
### Changed
110+
37111
- **Refactoring**:
38-
- `src/client/interfaces/client.ts` has been moved to `src/types/client.ts`.
39-
- `src/server/interfaces/context.ts` has been moved to `src/types/context.ts`.
40-
- Internal type imports throughout the codebase have been updated to reflect these changes.
112+
- `src/client/interfaces/client.ts` has been moved to `src/types/client.ts`.
113+
- `src/server/interfaces/context.ts` has been moved to `src/types/context.ts`.
114+
- Internal type imports throughout the codebase have been updated to reflect these changes.
41115
- Examples `examples/code-deployment.js` and `examples/code-deployment.ts` have been updated to use the new `artinet.v0.taskManager` and `artinet.v0.connect` utilities instead of the deprecated proxy functions.
42116
- Updated `@types/node` dependency to `^20.17.50`.
43117

44118
### Deprecated
119+
45120
- The `taskHandlerProxy` and `fetchResponseProxy` functions in `src/utils/deployment/task-wrapper.ts` are now deprecated. Developers should migrate to the new `artinet.v0.taskManager` and `artinet.v0.connect` utilities respectively.
46121

47122
### Removed
123+
48124
- Removed `json-schema-to-typescript` from `devDependencies` as it's no longer directly used.
49125

50126
### Fixed
127+
51128
- Minor wording update in the "QUICK-AGENT FAQs" section of `README.md` for clarity on searching by `registrationId/agentId`.
52129

53130
## [0.5.1] - 2025-05-12
54131

55132
### Added
133+
56134
- `fullDeployment` utility (`src/utils/deployment/full-deployment.ts`): Enables direct deployment of bundled agent code and its `AgentCard` to the Artinet platform. Requires an `ARTINET_API_KEY`.
57135
- New comprehensive test suite for deployment features (`tests/deployment.test.ts`), covering `testDeployment` and `fullDeployment`.
58136
- Agents registered via `A2AServer.registerServer()` or `register: true` now include `tags: ["a2a"]` in their registration payload.
59137

60138
### Changed
139+
61140
- The `handler` property in `A2AServerParams` (used to pass the agent's core logic) was previously documented and used in some examples as `taskHandler`. This has been corrected to `handler` consistently. While `taskHandler` might have worked due to object flexibility, `handler` is the intended property name.
62141
- Clarified type description for `ServerDeploymentRequestParams.dependencies` to note it is "currently unsupported".
63142
- Clarified type description for `BaseServerDeploymentResponseParams.deploymentId` regarding its value in full deployments.
64143

65144
### Fixed
145+
66146
- Improved error handling in `A2AClient` during `agentCard()` fetching:
67-
- Validates parsed URLs before use.
68-
- Ensures `AgentCard` objects contain a `name` property.
147+
- Validates parsed URLs before use.
148+
- Ensures `AgentCard` objects contain a `name` property.
69149
- Enhanced error logging in `src/transport/rpc/parser.ts` to include `error.message` for `SystemError` instances.
70150
- Prevented agent registration via `register()` utility if the `AgentCard.url` is localhost, 127.0.0.1, or empty, returning an empty string instead of attempting registration.
71151
- Corrected an issue in an example in `README.md` where `taskHandler` was used instead of `handler` for the `A2AServer` constructor (matches the breaking change clarification above).
@@ -74,24 +154,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
74154
## [0.5.0] - 2025-05-10
75155

76156
### Added
157+
77158
- `A2AServer.getExpressApp()`: New method to access the underlying Express application instance, allowing for more flexible server customization and middleware integration.
78159
- More specific error messages for various RPC errors (e.g., `TASK_NOT_FOUND`, `INVALID_PARAMS`, `PARSE_ERROR`), providing better debugging information and context.
79160

80161
### Changed
162+
81163
- **BREAKING**: The `data` parameter in the `SystemError` constructor and all specific error factory functions (e.g., `PARSE_ERROR()`, `INVALID_PARAMS()`, `TASK_NOT_FOUND()`) is now mandatory. This change aims to enhance error reporting by ensuring contextual information is always provided with errors.
82164
- **BREAKING**: Refactored the `createExpressServer` utility (`src/server/lib/express-server.ts`):
83-
- It no longer accepts a `port` parameter.
84-
- It no longer creates or returns an `http.Server` instance (i.e., it doesn't call `app.listen()`). It now solely configures and returns the Express `app` instance.
85-
- The responsibility of starting the HTTP server is now fully handled within the `A2AServer.start()` method, which uses the `app` configured by `createExpressServer`.
165+
- It no longer accepts a `port` parameter.
166+
- It no longer creates or returns an `http.Server` instance (i.e., it doesn't call `app.listen()`). It now solely configures and returns the Express `app` instance.
167+
- The responsibility of starting the HTTP server is now fully handled within the `A2AServer.start()` method, which uses the `app` configured by `createExpressServer`.
86168
- Updated numerous TypeScript type definitions in `src/types/schema.ts` to more strictly define optional properties. Many properties that were previously `type | null` are now just `type?`, and JSDoc `@default null` comments have been removed. This aligns with standard TypeScript practices where optional properties are either present with a value or absent (undefined), rather than being explicitly `null`.
87169
- When a task is initiated via `A2AServer.sendTaskAndStore()`, the initial task status (`Task.status`) no longer includes a `message: null` field.
88170
- In `src/server/lib/state.ts`, when creating a new task object during `loadState`, `sessionId` and `metadata` properties are assigned directly if provided, without defaulting to `null` if they are undefined.
89171
- Replaced generic `METHOD_NOT_FOUND()` errors with more specific `PUSH_NOTIFICATION_NOT_SUPPORTED()` errors in `defaultSetTaskPushNotificationMethod` and `defaultGetTaskPushNotificationMethod` when the agent's card indicates that push notifications are not supported.
90172

91173
### Removed
174+
92175
- The test file `tests/deployment.test.ts` has been removed. The `testDeployment` utility and related "Quick-Agents" features remain.
93176

94177
### Improved
178+
95179
- The documentation section in `README.md` regarding agent code deployment has been renamed from "Agent Code Deployment (Beta)" to "Quick-Agents (Alpha)". This section includes updated descriptions, code examples for bundling and testing agents, and a new FAQ.
96180
- Server startup logging in `A2AServer` now consistently uses `logInfo` for messages like "A2A Server started and listening".
97181

@@ -127,23 +211,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
127211

128212
- **BREAKING:** Renamed server configuration type from `A2AServerOptions` to `A2AServerParams` for consistency.
129213
- Updated dependencies to latest versions:
130-
- `eventsource-parser` to `^3.0.1`. Adapted streaming logic (`handleEventStream`) to use `EventSourceMessage` type from this library.
131-
- `express` to `^5.1.0`.
132-
- `jayson` to `^4.2.0`.
133-
- `node:16` to `node:22`
134-
- `ES2020` to `ES2022`
214+
- `eventsource-parser` to `^3.0.1`. Adapted streaming logic (`handleEventStream`) to use `EventSourceMessage` type from this library.
215+
- `express` to `^5.1.0`.
216+
- `jayson` to `^4.2.0`.
217+
- `node:16` to `node:22`
218+
- `ES2020` to `ES2022`
135219
- Updated various code examples in documentation for improved clarity and consistency (`README.md`, `examples/`).
136220

137221
### Improved
138222

139223
- Refactored server JSON-RPC method handling:
140-
- Introduced `createJSONRPCMethod` helper for wrapping A2A method logic with dependency injection and error handling.
141-
- Exported default implementations for standard A2A methods (e.g., `defaultSendTaskMethod`) from `lib/middleware/a2a-methods.js`.
142-
- Provided `defaultCreateJSONRPCServer` factory demonstrating standard server setup. This simplifies advanced server customization.
224+
- Introduced `createJSONRPCMethod` helper for wrapping A2A method logic with dependency injection and error handling.
225+
- Exported default implementations for standard A2A methods (e.g., `defaultSendTaskMethod`) from `lib/middleware/a2a-methods.js`.
226+
- Provided `defaultCreateJSONRPCServer` factory demonstrating standard server setup. This simplifies advanced server customization.
143227
- Significantly revised and expanded `README.md` documentation:
144-
- Updated Features, Class Documentation, and Usage sections.
145-
- Added detailed section on Server Registration & Discovery.
146-
- Corrected and clarified Advanced Server Customization examples.
228+
- Updated Features, Class Documentation, and Usage sections.
229+
- Added detailed section on Server Registration & Discovery.
230+
- Corrected and clarified Advanced Server Customization examples.
147231
- Updated test suite to incorporate tests for new server registration and fallback path functionalities.
148232

149233
## [0.2.0] - 2025-04-25
@@ -180,7 +264,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
180264
- Support for streaming responses and push notifications
181265
- Comprehensive test suite and documentation
182266

183-
<!-- [Unreleased]: https://github.com/artinet/sdk/compare/v0.5.1...HEAD -->
267+
<!-- [Unreleased]: https://github.com/artinet/sdk/compare/v0.5.6...HEAD -->
268+
269+
[0.5.6]: https://github.com/the-artinet-project/artinet-sdk/compare/v0.5.4...v0.5.6
184270
[0.5.2]: https://github.com/the-artinet-project/artinet-sdk/compare/v0.5.1...v0.5.2
185271
[0.5.1]: https://github.com/the-artinet-project/artinet-sdk/compare/v0.5.0...v0.5.1
186272
[0.5.0]: https://github.com/the-artinet-project/artinet-sdk/compare/v0.4.1...v0.5.0

0 commit comments

Comments
 (0)