Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .claude/agents/architecture-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ Escalate to team discussion when:

### Dependency Flow
```
runtime → observability → observability-hosting → observability-extensions-*
runtime → tooling → tooling-extensions-*
runtime → notifications
```
Expand All @@ -240,16 +239,15 @@ runtime → notifications
| Package | Responsibility |
|---------|---------------|
| runtime | Foundation utilities, no external SDK deps |
| observability | OpenTelemetry tracing infrastructure |
| tooling | MCP server configuration and discovery |
| notifications | Agent lifecycle event handling |
| *-extensions-* | Framework-specific adapters |

### Design Patterns
| Pattern | Usage |
|---------|-------|
| Singleton | ObservabilityManager (single tracer provider) |
| Disposable | Scope classes (automatic span lifecycle) |
| Builder | BaggageBuilder, ObservabilityBuilder (fluent config) |
| Configuration Provider | Runtime and Tooling dynamic configuration |
| Strategy | McpToolServerConfigurationService (dev vs prod) |
| Extension Methods | Notifications extending AgentApplication |

Observability packages are retired. Application telemetry belongs to `@microsoft/opentelemetry`; consult `docs/observability-migration.md`, not deleted SDK APIs.
8 changes: 4 additions & 4 deletions .claude/agents/code-review-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@ When the task-implementer completes work:
I've completed the implementation for [feature]. Please review:

Files created:
- packages/agents-a365-observability/src/customProcessor.ts
- tests/observability/customProcessor.test.ts
- packages/agents-a365-tooling/src/discoveryRetry.ts
- tests/tooling/discoveryRetry.test.ts

Files modified:
- packages/agents-a365-observability/src/index.ts
- packages/agents-a365-observability/src/ObservabilityBuilder.ts
- packages/agents-a365-tooling/src/index.ts
- packages/agents-a365-tooling/src/McpToolServerConfigurationService.ts

Test results: 24 passed, 0 failed
Lint: No errors
Expand Down
26 changes: 5 additions & 21 deletions .claude/agents/code-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,28 +311,12 @@ try {

## SDK-Specific Patterns

### Disposable Pattern
### Configuration Providers
```typescript
// ✅ Correct usage with 'using' keyword
using scope = InvokeAgentScope.start(details, tenantDetails);
// Span automatically ends when scope is disposed
```
import { defaultRuntimeConfigurationProvider } from '@microsoft/agents-a365-runtime';

### Builder Pattern
```typescript
// ✅ Fluent API usage
const baggage = new BaggageBuilder()
.tenantId(tenantId)
.agentId(agentId)
.correlationId(correlationId)
.build();
const config = defaultRuntimeConfigurationProvider.getConfiguration();
const cluster = config.clusterCategory;
```

### Singleton Access
```typescript
// ✅ Proper singleton usage
const manager = ObservabilityManager.getInstance();
if (manager === null) {
throw new Error('ObservabilityManager not initialized');
}
```
Evaluate dynamic getter values at their point of use; overrides may vary per request. Observability is retired from this SDK; application integrations use the distro described in `docs/observability-migration.md`.
4 changes: 2 additions & 2 deletions .claude/agents/pr-comment-resolver.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ Types: `fix`, `refactor`, `style`, `docs`, `test`

Example:
```
fix(observability): add null check for tenant ID
fix(runtime): add null check for tenant ID

Addresses review comment [CRM-003]
- Added explicit null check before accessing tenantId
- Prevents potential runtime error when baggage is missing
- Prevents potential runtime error when request identity is missing
```

### Phase 3: Verification
Expand Down
21 changes: 9 additions & 12 deletions .claude/agents/prd-task-generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ When generating tasks, consider:

### Package Placement
- **Runtime**: Shared utilities, no external SDK dependencies
- **Observability**: OpenTelemetry integration, tracing scopes
- **Tooling**: MCP server configuration and discovery
- **Notifications**: Agent lifecycle event handling
- **Extensions**: Framework-specific adapters (OpenAI, Claude, LangChain)
Expand All @@ -88,7 +87,6 @@ When generating tasks, consider:
- Use workspace protocol: `"@microsoft/agents-a365-runtime": "workspace:*"`
- Understand the dependency flow:
```
runtime → observability → observability-hosting → observability-extensions-*
runtime → tooling → tooling-extensions-*
runtime → notifications
```
Expand All @@ -99,9 +97,8 @@ When generating tasks, consider:
- Build output: `dist/cjs/`, `dist/esm/`

### Observability Integration
- New features should emit appropriate spans
- Use existing scope classes: `InvokeAgentScope`, `InferenceScope`, `ExecuteToolScope`
- Propagate baggage context for correlation
- Application telemetry is owned by the external `@microsoft/opentelemetry` distro.
- Follow `docs/observability-migration.md`; do not recreate retired scope implementations or add the distro to unaffected SDK packages.

## Deliverable Format

Expand Down Expand Up @@ -167,25 +164,25 @@ Before finalizing, verify:

## Example Output

**Input**: PRD for adding custom span processors to observability
**Input**: PRD for adding configurable MCP discovery retries to Tooling

**Output**:
```markdown
# Implementation Plan: Custom Span Processors
# Implementation Plan: MCP Discovery Retries

## Executive Summary
This plan breaks down the custom span processor feature into 6 tasks across 3 phases. The implementation adds a plugin architecture to ObservabilityBuilder while maintaining backward compatibility.
This plan breaks down configurable discovery retries into 6 tasks across 3 phases, preserving existing defaults and request-specific configuration.

## Architecture Impact
- **Primary Package**: `@microsoft/agents-a365-observability`
- **Primary Package**: `@microsoft/agents-a365-tooling`
- **Dependencies**: None new
- **Breaking Changes**: None (additive API)

## Phase 1: Foundation (2 tasks)

### Task 1.1: Define SpanProcessor Interface
**Package**: `@microsoft/agents-a365-observability`
**Description**: Create the interface contract for custom span processors...
### Task 1.1: Define Retry Configuration
**Package**: `@microsoft/agents-a365-tooling`
**Description**: Define bounded retries and backoff with existing configuration-provider patterns...
...

## Phase 2: Core Implementation (2 tasks)
Expand Down
18 changes: 9 additions & 9 deletions .claude/agents/prd-writer.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,14 @@ Systematically extract:
### 2. Contextual Awareness

Maintain alignment with the SDK's architecture:
- **Monorepo structure**: 9 interdependent packages in `packages/`
- **Monorepo structure**: Six maintained packages in `packages/`
- **Core + Extensions pattern**: Framework-agnostic core with framework-specific extensions
- **Package categories**:
- Runtime: Foundation utilities
- Observability: OpenTelemetry tracing
- Tooling: MCP server configuration
- Notifications: Agent lifecycle events
- **TypeScript standards**: Strict typing, interfaces over types where appropriate
- **Design patterns**: Singleton, Disposable, Builder, Strategy, Extension Methods
- **Design patterns**: Configuration Provider, Strategy, Extension Methods
- **Async/await conventions**: Promise-based APIs for I/O operations
- **Dual module format**: Both CJS and ESM builds required

Expand All @@ -49,7 +48,7 @@ Maintain alignment with the SDK's architecture:
Before drafting, ask targeted questions:

1. "What problem does this solve for developers?"
2. "Which packages are affected?" (runtime, observability, tooling, notifications, extensions)
2. "Which packages are affected?" (runtime, tooling, notifications, tooling extensions)
3. "Does this extend core functionality or require a new extension package?"
4. "What are the measurable success metrics?"
5. "Are there security or compliance considerations?"
Expand Down Expand Up @@ -97,6 +96,7 @@ Generate documents with these sections:
- Usage examples

### 8. Observability
- Application-owned telemetry uses the external Microsoft OpenTelemetry distro; see `docs/observability-migration.md`. No telemetry package is maintained here.
- Tracing integration requirements
- Span attributes and events
- Metrics to capture
Expand Down Expand Up @@ -173,15 +173,15 @@ PRDs must be:

## Example Interaction

**User**: "I want to add support for custom span processors in the observability package"
**User**: "I want to add configurable MCP discovery retries in the tooling package"

**PRD Writer Response**:
"Before I draft the PRD, I have a few clarifying questions:

1. Should custom processors run before or after the built-in Agent365Exporter?
2. Will this require changes to the ObservabilityBuilder API?
3. Should processors have access to the baggage context (tenant ID, agent ID)?
4. Are there specific use cases driving this? (e.g., filtering, sampling, custom export)
1. Which transient discovery failures should be retried?
2. Will this require changes to ToolingConfiguration?
3. Should retry settings vary per tenant/request?
4. What latency and attempt limits are required?
5. Should this be backward-compatible with existing configurations?

Once I understand these aspects, I'll create a comprehensive PRD covering the API design, integration points, and testing strategy."
8 changes: 3 additions & 5 deletions .claude/agents/task-implementer.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ Before writing code:
Determine:
- **Package placement**: Core package or extension?
- **Pattern alignment**: Which design patterns apply?
- Singleton (ObservabilityManager)
- Disposable (Scope classes with `using` keyword)
- Builder (BaggageBuilder, ObservabilityBuilder)
- Configuration Provider (Runtime and Tooling dynamic overrides)
- Strategy (environment-based configuration)
- Extension Methods (TypeScript declaration merging)
- **Cross-package impacts**: Dependencies, shared types
Expand Down Expand Up @@ -201,10 +199,10 @@ Before requesting code review, verify:

- **Node.js versions**: >=18.0.0
- **TypeScript**: Strict mode enabled
- **Structure**: pnpm workspace monorepo with 9 packages
- **Structure**: pnpm workspace monorepo with six maintained packages
- **Package naming**: `@microsoft/agents-a365-<name>`
- **Build output**: Dual format (CJS and ESM)
- **Observability**: OpenTelemetry for traces, spans, metrics
- **Application telemetry**: External `@microsoft/opentelemetry` distro; see `docs/observability-migration.md`. Do not reintroduce retired SDK packages.
- **Tool integration**: MCP (Model Context Protocol)
- **Testing**: Jest with ts-jest preset

Expand Down
3 changes: 0 additions & 3 deletions .claude/agents/test-coverage-reviewer.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ Provide specific recommendations:
### Test Directory Structure
```
tests/
├── observability/
│ ├── BaggageBuilder.test.ts
│ └── InvokeAgentScope.test.ts
├── runtime/
│ └── Utility.test.ts
├── tooling/
Expand Down
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# This will eventually be replaced by security group
* @microsoft/agent365-approvers
/.github/ @microsoft/agent365-approvers
/packages/agents-a365-observability*/ @microsoft/agent365-observability-approvers
/tests/observability/ @microsoft/agent365-observability-approvers
/docs/observability-migration.md @microsoft/agent365-observability-approvers
/packages/agents-a365-notifications/ @microsoft/agent365-tooling-approvers
/packages/agents-a365-tooling*/ @microsoft/agent365-tooling-approvers
/tests/tooling*/ @microsoft/agent365-tooling-approvers
90 changes: 17 additions & 73 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,94 +79,38 @@ jobs:
with:
version: 10.20.0

- name: Match pnpm runtime to selected Node.js
run: pnpm config set --location=project useNodeVersion "$(node -p 'process.versions.node')"

- name: Install dependencies
run: pnpm i
run: pnpm install --frozen-lockfile

- name: Lint code
run: npm run lint
run: pnpm lint

- name: Set version with Nerdbank.GitVersioning
run: node setVersion.js

- name: Build package
run: npm run build
run: pnpm build

- name: Type check remaining packages
run: pnpm typecheck

- name: Run tests
run: npm test
env:
A365_EXPECTED_NODE_MAJOR: ${{ matrix.node-version }}
run: pnpm test
Comment thread
nikhilNava marked this conversation as resolved.
Resolved

- name: Pack packages
run: npm run pack
run: pnpm run pack artifacts/release-${{ matrix.node-version }}

# Copy packages to drop folder
- name: Copy packages to drop folder
run: |
mkdir -p ~/drop/nodejs-${{ matrix.node-version }} && cp -v packages/*.tgz $_
- name: Verify release artifacts independently
run: node packPackages.js --verify artifacts/release-${{ matrix.node-version }}

- name: Upload NPM packages as artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: nodejs-${{ matrix.node-version }}
path: ~/drop/nodejs-${{ matrix.node-version }}/*.tgz

# - name: Publish to NPM (commented for now)
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

integration-tests:
name: Integration tests
needs: [nodejs-sdk]
# Pull request workflows can be edited by the PR author, so the Azure OpenAI key lives in the
# integration-tests environment, which only allows deployments from main.
if: github.event_name == 'push'
runs-on: ubuntu-latest
environment: integration-tests
permissions:
contents: read

strategy:
matrix:
node-version: ['18', '20']

steps:
- name: Checkout repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
with:
fetch-depth: 0

- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
name: Install pnpm
with:
run_install: false

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'

- name: Setup pnpm
uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0
with:
version: 10.20.0

- name: Install dependencies
run: pnpm i

- name: Set version with Nerdbank.GitVersioning
run: node setVersion.js

- name: Build package
run: npm run build

- name: Run integration tests
env:
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }}
AZURE_OPENAI_DEPLOYMENT: ${{ vars.AZURE_OPENAI_DEPLOYMENT }}
AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }}
ENABLE_OBSERVABILITY: ${{ vars.ENABLE_OBSERVABILITY }}
run: |
npm run test:integration
path: artifacts/release-${{ matrix.node-version }}/
if-no-files-found: error
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"code-reviewer",
"test-coverage-reviewer"
],
"jest.jestCommandLine": "node --experimental-vm-modules node_modules/jest/bin/jest.js --config=tests/jest.config.cjs",
"jest.jestCommandLine": "pnpm test",
"jest.rootPath": "."
}
Loading
Loading