Skip to content
Merged
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
6 changes: 5 additions & 1 deletion nodejs/devin/sample-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ For comprehensive documentation and guidance on building agents with the Microso

## Prerequisites

- Node.js 18.x or higher
- Node.js 24.x or higher
- Microsoft Agent 365 SDK
- Devin API credentials

## Running the Agent

To set up and test this agent, refer to the [Configure Agent Testing](https://learn.microsoft.com/en-us/microsoft-agent-365/developer/testing?tabs=nodejs) guide for complete instructions.

## Deploying the Agent

Refer to the [Deploy and publish agents](https://learn.microsoft.com/en-us/microsoft-agent-365/developer/publish-deploy-agent?tabs=nodejs) guide for complete instructions.

## Support

For issues, questions, or feedback:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": "66f7a59f-d970-47a7-b178-4994374441c3",
"schemaVersion": "0.1.0-preview",
"agentIdentityBlueprintId": "95587a14-6731-46c4-ab67-3daf4eafd0f8",
"communicationProtocol": "activityProtocol"
}
Binary file added nodejs/devin/sample-agent/manifest/color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions nodejs/devin/sample-agent/manifest/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/vDevPreview/MicrosoftTeams.schema.json",
"id": "80939348-93ed-4478-9e24-a585b859c9a0",
"name": {
"short": "Devin Sample Agent",
"full": "Devin Sample Agent"
},
"description": {
"short": "Devin is the AI software engineer.",
"full": "Devin is an AI coding agent and software engineer that helps developers build better software faster."
},
"icons": {
"outline": "outline.png",
"color": "color.png"
},
"accentColor": "#07687d",
"version": "1.0.0",
"manifestVersion": "devPreview",
"developer": {
"name": "Agent Developer",
"mpnId": "",
"websiteUrl": "https://go.microsoft.com/fwlink/?LinkId=518021",
"privacyUrl": "https://go.microsoft.com/fwlink/?LinkId=518021",
"termsOfUseUrl": "https://shares.datatransfer.microsoft.com/assets/Microsoft_Terms_of_Use.html"
},
"agenticUserTemplates": [
{
"id": "66f7a59f-d970-47a7-b178-4994374441c3",
"file": "agenticUserTemplateManifest.json"
}
]
}
Binary file added nodejs/devin/sample-agent/manifest/outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 3 additions & 9 deletions nodejs/devin/sample-agent/src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { Activity, ActivityTypes } from "@microsoft/agents-activity";
import {
AgentApplication,
AgentApplicationOptions,
DefaultConversationState,
MemoryStorage,
TurnContext,
TurnState,
Expand All @@ -25,13 +24,9 @@ import { Stream } from "stream";
import { v4 as uuidv4 } from "uuid";
import { devinClient } from "./devin-client";
import tokenCache from "./token-cache";
import { ApplicationTurnState } from "./types/agent.types";
import { getAgentDetails, getTenantDetails } from "./utils";

interface ConversationState extends DefaultConversationState {
count: number;
}
type ApplicationTurnState = TurnState<ConversationState>;

export class A365Agent extends AgentApplication<ApplicationTurnState> {
isApplicationInstalled: boolean = false;
agentName = "Devin Agent";
Expand All @@ -46,7 +41,7 @@ export class A365Agent extends AgentApplication<ApplicationTurnState> {
// Initialize Observability SDK
const observabilitySDK = ObservabilityManager.configure((builder) =>
builder
.withService("claude-travel-agent", "1.0.0")
.withService("devin-sample-agent", "1.0.0")
.withTokenResolver(async (agentId, tenantId) => {
// Token resolver for authentication with Agent 365 observability
console.log(
Expand Down Expand Up @@ -174,6 +169,7 @@ export class A365Agent extends AgentApplication<ApplicationTurnState> {
agentDetails,
tenantDetails
);
inferenceScope.recordInputMessages([userMessage]);

let totalResponseLength = 0;
const responseStream = new Stream()
Expand All @@ -193,8 +189,6 @@ export class A365Agent extends AgentApplication<ApplicationTurnState> {
inferenceScope.recordFinishReasons(["stop"]);
});

inferenceScope.recordInputMessages([userMessage]);

await devinClient.invokeAgent(userMessage, responseStream);
} catch (error) {
invokeAgentScope.recordOutputMessages([`LLM error: ${error}`]);
Expand Down
10 changes: 10 additions & 0 deletions nodejs/devin/sample-agent/src/types/agent.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import { DefaultConversationState, TurnState } from "@microsoft/agents-hosting";

interface ConversationState extends DefaultConversationState {
count: number;
}

export type ApplicationTurnState = TurnState<ConversationState>;
Loading