Skip to content

Commit 356f8be

Browse files
Merge branch 'main' into users/mrunalhirve/NodeJsUnitTests
2 parents 09b13d9 + 51a10e7 commit 356f8be

9 files changed

Lines changed: 375 additions & 82 deletions

File tree

CONTRIBUTING.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Contributing to Agent365-nodejs
2+
3+
First off, thank you for taking the time to contribute! 🎉
4+
5+
We welcome contributions from everyone, whether you're fixing bugs, adding new features, or improving documentation. Here are a few guidelines to help you get started.
6+
7+
## Table of Contents
8+
- [Code of Conduct](#code-of-conduct)
9+
- [How to Contribute](#how-to-contribute)
10+
- [Reporting Bugs](#reporting-bugs)
11+
- [Suggesting Enhancements](#suggesting-enhancements)
12+
- [Submitting Code Changes](#submitting-code-changes)
13+
- [Development Process](#development-process)
14+
- [License](#license)
15+
16+
## Code of Conduct
17+
18+
By participating in this project, you agree to abide by the [Code of Conduct](CODE_OF_CONDUCT.md). Please be respectful and considerate to others, as we want to foster a friendly and inclusive community.
19+
20+
## How to Contribute
21+
22+
We appreciate any help! There are several ways you can contribute to this project:
23+
24+
### Reporting Bugs
25+
- If you find a bug, please check if it has already been reported. If not, open a new issue with a clear description of the problem and how to reproduce it.
26+
- Provide any relevant information like logs, steps to reproduce, or screenshots to help us understand the issue better.
27+
28+
### Suggesting Enhancements
29+
- If you have an idea for a new feature or improvement, please open an issue to discuss it first. This allows us to prioritize the feature and make sure it fits with the project vision.
30+
- Clearly describe the idea and its potential impact.
31+
32+
### Submitting Code Changes
33+
- Fork the repository and create a new branch for your feature or bugfix.
34+
- Write clear, descriptive commit messages.
35+
- Follow the coding style used in the project (indentation, variable names, etc.).
36+
- If applicable, add tests that ensure your changes work as expected.
37+
- Submit a pull request with a description of what you've done and why.
38+
- Make sure your changes pass any automated checks or tests (e.g., CI/CD pipeline).
39+
40+
## Development Process
41+
42+
1. Fork the repository and clone it to your local machine.
43+
2. Create a new branch for your changes.
44+
3. Make the necessary changes and ensure the project works as expected.
45+
4. Commit your changes and push them to your fork.
46+
5. Open a pull request. Make sure to include a detailed description of what you've changed and why.
47+
48+
### Code Reviews
49+
- After you submit a pull request, the maintainers will review it. If they have any questions or requests for changes, they will provide feedback.
50+
- Address the feedback and make any necessary changes before the pull request is merged.
51+
52+
## License
53+
54+
By contributing to this project, you agree that your contributions will be licensed under the same license as the project. See [LICENSE](LICENSE.md) for more details.
55+
56+
---
57+
58+
Thank you for contributing! 🎉 We appreciate your help in making this project better.

DEPENDENCIES.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Microsoft Agent 365 SDK Node.js Package Dependencies
2+
3+
This diagram shows the internal dependencies between Microsoft Agent 365 SDK Node.js packages.
4+
5+
```mermaid
6+
graph LR
7+
agents_a365_notifications[agents-a365-notifications]
8+
agents_a365_observability[agents-a365-observability]
9+
agents_a365_observability_extensions_openai[agents-a365-observability-extensions-openai]
10+
agents_a365_observability_tokencache[agents-a365-observability-tokencache]
11+
agents_a365_runtime[agents-a365-runtime]
12+
agents_a365_tooling[agents-a365-tooling]
13+
agents_a365_tooling_extensions_claude[agents-a365-tooling-extensions-claude]
14+
agents_a365_tooling_extensions_langchain[agents-a365-tooling-extensions-langchain]
15+
agents_a365_tooling_extensions_openai[agents-a365-tooling-extensions-openai]
16+
17+
agents_a365_notifications --> agents_a365_runtime
18+
agents_a365_observability --> agents_a365_runtime
19+
agents_a365_observability_extensions_openai --> agents_a365_observability
20+
agents_a365_observability_tokencache --> agents_a365_observability
21+
agents_a365_observability_tokencache --> agents_a365_runtime
22+
agents_a365_tooling --> agents_a365_runtime
23+
agents_a365_tooling_extensions_claude --> agents_a365_runtime
24+
agents_a365_tooling_extensions_claude --> agents_a365_tooling
25+
agents_a365_tooling_extensions_langchain --> agents_a365_runtime
26+
agents_a365_tooling_extensions_langchain --> agents_a365_tooling
27+
agents_a365_tooling_extensions_openai --> agents_a365_runtime
28+
agents_a365_tooling_extensions_openai --> agents_a365_tooling
29+
30+
style agents_a365_notifications fill:#ffcdd2,stroke:#c62828,color:#280505
31+
style agents_a365_observability fill:#c8e6c9,stroke:#2e7d32,color:#142a14
32+
style agents_a365_observability_extensions_openai fill:#e8f5e9,stroke:#66bb6a,color:#1f3d1f
33+
style agents_a365_observability_tokencache fill:#e8f5e9,stroke:#66bb6a,color:#1f3d1f
34+
style agents_a365_runtime fill:#bbdefb,stroke:#1565c0,color:#0d1a26
35+
style agents_a365_tooling fill:#ffe0b2,stroke:#e65100,color:#331a00
36+
style agents_a365_tooling_extensions_claude fill:#fff3e0,stroke:#fb8c00,color:#4d2600
37+
style agents_a365_tooling_extensions_langchain fill:#fff3e0,stroke:#fb8c00,color:#4d2600
38+
style agents_a365_tooling_extensions_openai fill:#fff3e0,stroke:#fb8c00,color:#4d2600
39+
```
40+
## Package Types
41+
42+
- **Notifications** (Red): Notification and messaging extensions
43+
- **Observability** (Green): Telemetry and monitoring core
44+
- **Observability Extensions** (Light Green): Framework-specific observability integrations
45+
- **Runtime** (Blue): Core runtime components
46+
- **Tooling** (Orange): Agent tooling SDK core
47+
- **Tooling Extensions** (Light Orange): Framework-specific tooling integrations
48+

generate-package-dependencies.js

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
import fs from 'fs';
5+
import path from 'path';
6+
import { fileURLToPath } from 'url';
7+
8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = path.dirname(__filename);
10+
11+
// Color definitions for package types
12+
const packageTypeColors = {
13+
'Notifications': { fill: '#ffcdd2', stroke: '#c62828', color: '#280505' },
14+
'Observability': { fill: '#c8e6c9', stroke: '#2e7d32', color: '#142a14' },
15+
'Observability Extensions': { fill: '#e8f5e9', stroke: '#66bb6a', color: '#1f3d1f' },
16+
'Runtime': { fill: '#bbdefb', stroke: '#1565c0', color: '#0d1a26' },
17+
'Tooling': { fill: '#ffe0b2', stroke: '#e65100', color: '#331a00' },
18+
'Tooling Extensions': { fill: '#fff3e0', stroke: '#fb8c00', color: '#4d2600' }
19+
};
20+
21+
// Package to type mapping
22+
const packageToType = {
23+
'agents-a365-notifications': 'Notifications',
24+
'agents-a365-observability': 'Observability',
25+
'agents-a365-observability-extensions-openai': 'Observability Extensions',
26+
'agents-a365-observability-tokencache': 'Observability Extensions',
27+
'agents-a365-runtime': 'Runtime',
28+
'agents-a365-tooling': 'Tooling',
29+
'agents-a365-tooling-extensions-claude': 'Tooling Extensions',
30+
'agents-a365-tooling-extensions-langchain': 'Tooling Extensions',
31+
'agents-a365-tooling-extensions-openai': 'Tooling Extensions'
32+
};
33+
34+
// Find all package directories matching the pattern
35+
function findPackages() {
36+
const packagesDir = path.join(__dirname, 'packages');
37+
const packages = [];
38+
39+
const dirs = fs.readdirSync(packagesDir, { withFileTypes: true });
40+
41+
for (const dir of dirs) {
42+
if (dir.isDirectory() && dir.name.startsWith('agents-a365-')) {
43+
const packageJsonPath = path.join(packagesDir, dir.name, 'package.json');
44+
if (fs.existsSync(packageJsonPath)) {
45+
packages.push({
46+
name: dir.name,
47+
path: packageJsonPath
48+
});
49+
}
50+
}
51+
}
52+
53+
return packages;
54+
}
55+
56+
// Read and parse package.json
57+
function readPackageJson(packagePath) {
58+
const content = fs.readFileSync(packagePath, 'utf-8');
59+
return JSON.parse(content);
60+
}
61+
62+
// Extract dependencies related to our packages
63+
function extractRelevantDependencies(packageJson, relevantPackageNames) {
64+
const deps = [];
65+
const allDeps = {
66+
...packageJson.dependencies,
67+
...packageJson.devDependencies,
68+
...packageJson.peerDependencies
69+
};
70+
71+
for (const [depName, version] of Object.entries(allDeps || {})) {
72+
// Check if this dependency is one of our packages
73+
if (relevantPackageNames.has(depName)) {
74+
deps.push(depName);
75+
}
76+
}
77+
78+
return deps;
79+
}
80+
81+
// Generate Mermaid diagram
82+
function generateMermaidDiagram(packages) {
83+
let mermaid = '```mermaid\ngraph LR\n';
84+
85+
// Create a map of package names to directory names
86+
const packageNameToDir = new Map();
87+
for (const pkg of packages) {
88+
packageNameToDir.set(pkg.packageName, pkg.name);
89+
}
90+
91+
// Create nodes
92+
for (const pkg of packages) {
93+
const nodeId = pkg.name.replace(/-/g, '_');
94+
mermaid += ` ${nodeId}[${pkg.name}]\n`;
95+
}
96+
97+
mermaid += '\n';
98+
99+
// Create edges (dependencies)
100+
for (const pkg of packages) {
101+
const nodeId = pkg.name.replace(/-/g, '_');
102+
for (const dep of pkg.dependencies) {
103+
// Convert package name to directory name
104+
const depDirName = packageNameToDir.get(dep);
105+
if (depDirName) {
106+
const depId = depDirName.replace(/-/g, '_');
107+
mermaid += ` ${nodeId} --> ${depId}\n`;
108+
}
109+
}
110+
}
111+
112+
mermaid += '\n';
113+
114+
// Add styling
115+
for (const pkg of packages) {
116+
const nodeId = pkg.name.replace(/-/g, '_');
117+
const packageType = packageToType[pkg.name];
118+
if (packageType) {
119+
const colors = packageTypeColors[packageType];
120+
if (colors) {
121+
mermaid += ` style ${nodeId} fill:${colors.fill},stroke:${colors.stroke},color:${colors.color}\n`;
122+
}
123+
}
124+
}
125+
126+
mermaid += '```\n';
127+
128+
return mermaid;
129+
}
130+
131+
// Main function
132+
function main() {
133+
console.log('Finding packages...');
134+
const packageList = findPackages();
135+
console.log(`Found ${packageList.length} packages`);
136+
137+
// Get all package names for filtering dependencies
138+
const relevantPackageNames = new Set(packageList.map(p => {
139+
const pkgJson = readPackageJson(p.path);
140+
return pkgJson.name;
141+
}));
142+
143+
console.log('Analyzing dependencies...');
144+
const packagesWithDeps = packageList.map(pkg => {
145+
const packageJson = readPackageJson(pkg.path);
146+
const dependencies = extractRelevantDependencies(packageJson, relevantPackageNames);
147+
148+
console.log(` ${pkg.name}: ${dependencies.length} dependencies`);
149+
150+
return {
151+
name: pkg.name,
152+
packageName: packageJson.name,
153+
dependencies
154+
};
155+
});
156+
157+
console.log('Generating Mermaid diagram...');
158+
const diagram = generateMermaidDiagram(packagesWithDeps);
159+
160+
// Add header and legend
161+
let markdown = '# Microsoft Agent 365 SDK Node.js Package Dependencies\n\n';
162+
markdown += 'This diagram shows the internal dependencies between Microsoft Agent 365 SDK Node.js packages.\n\n';
163+
markdown += diagram;
164+
markdown += '## Package Types\n\n';
165+
markdown += '- **Notifications** (Red): Notification and messaging extensions\n';
166+
markdown += '- **Observability** (Green): Telemetry and monitoring core\n';
167+
markdown += '- **Observability Extensions** (Light Green): Framework-specific observability integrations\n';
168+
markdown += '- **Runtime** (Blue): Core runtime components\n';
169+
markdown += '- **Tooling** (Orange): Agent tooling SDK core\n';
170+
markdown += '- **Tooling Extensions** (Light Orange): Framework-specific tooling integrations\n\n';
171+
172+
const outputPath = path.join(__dirname, 'DEPENDENCIES.md');
173+
fs.writeFileSync(outputPath, markdown, 'utf-8');
174+
175+
console.log(`\nDiagram generated successfully: ${outputPath}`);
176+
}
177+
178+
main();

packages/agents-a365-tooling-extensions-claude/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@microsoft/agents-a365-runtime": "workspace:*",
3939
"@microsoft/agents-a365-tooling": "workspace:*",
4040
"@microsoft/agents-hosting": "*",
41-
"@modelcontextprotocol/sdk": "*"
41+
"@modelcontextprotocol/sdk": "workspace:*"
4242
},
4343
"devDependencies": {
4444
"@eslint/js": "^9.39.1",

packages/agents-a365-tooling/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"dependencies": {
3636
"@microsoft/agents-a365-runtime": "workspace:*",
3737
"@microsoft/agents-hosting": "*",
38-
"@modelcontextprotocol/sdk": "*",
38+
"@modelcontextprotocol/sdk": "workspace:*",
3939
"express": "^5.2.0"
4040
},
4141
"devDependencies": {

packages/agents-a365-tooling/src/contracts.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ export interface MCPServerConfig {
99

1010
export interface McpClientTool {
1111
name: string;
12-
description: string;
12+
description?: string;
1313
inputSchema: InputSchema;
1414
}
1515

1616
export interface InputSchema {
1717
type: string;
18-
properties: Record<string, { type: string; description?: string; enum?: string[] }>;
18+
properties?: Record<string, object>;
1919
required?: string[];
2020
additionalProperties?: boolean;
2121
}

0 commit comments

Comments
 (0)