Skip to content
12 changes: 0 additions & 12 deletions compat/baseline/agents-copilotstudio-client.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,6 @@ export interface CopilotStudioWebChatSettings {
showTyping?: boolean;
}

// @public
export class ExecuteTurnRequest {
constructor(activity?: Activity);
activity?: Activity;
}

// @public
export function getCopilotStudioConnectionUrl(settings: ConnectionSettings, conversationId?: string): string;

// @public
export function getTokenAudience(settings?: ConnectionSettings, cloud?: PowerPlatformCloud, cloudBaseAddress?: string, directConnectUrl?: string): string;

// @public
export const loadCopilotStudioConnectionSettingsFromEnv: () => ConnectionSettings;

Expand Down
254 changes: 145 additions & 109 deletions compat/baseline/agents-hosting.api.md

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions packages/agents-copilotstudio-client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ export * from './connectionSettings.js'
export * from './copilotStudioClient.js'
export * from './copilotStudioConnectionSettings.js'
export * from './copilotStudioWebChat.js'
export * from './executeTurnRequest.js'
export * from './powerPlatformCloud.js'
export * from './powerPlatformEnvironment.js'
10 changes: 1 addition & 9 deletions packages/agents-hosting/src/app/agentApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,16 +593,8 @@ export class AgentApplication<TState extends TurnState> {
* 8. Executes after-turn event handlers
* 9. Saves turn state
*
* @example
* ```typescript
* const handled = await app.runInternal(turnContext);
* if (!handled) {
* console.log('No handler matched the activity');
* }
* ```
*
*/
public async runInternal (turnContext: TurnContext): Promise<boolean> {
private async runInternal (turnContext: TurnContext): Promise<boolean> {
if (turnContext.activity.type === ActivityTypes.Typing) {
return false
}
Expand Down
4 changes: 2 additions & 2 deletions packages/agents-hosting/src/app/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export * from './agentApplication'
export * from './agentApplicationBuilder'
export * from './agentApplicationOptions'
export * from './appRoute'
export * from './attachmentDownloader'
export * from './conversationUpdateEvents'
export { Authorization } from './auth/authorization'
export * from './routeHandler'
export * from './routeList'
export * from './routeRank'
export * from './routeSelector'
export * from './attachmentDownloader'
Expand Down
4 changes: 2 additions & 2 deletions packages/agents-hosting/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export * from './invoke'
export * from './oauth'
export * from './state'
export * from './storage'
export * from './transcript'
export { ConsoleTranscriptLogger, PagedResult, TranscriptInfo, TranscriptLogger, TranscriptStore } from './transcript'

export * from './activityHandler'
export * from './baseAdapter'
Expand All @@ -24,6 +24,6 @@ export * from './statusCodes'
export * from './turnContext'
export * from './turnContextStateCollection'
export * from './storage/storage'
export * from './headerPropagation'
export { HeaderPropagationCollection, HeaderPropagationDefinition } from './headerPropagation'

export * from './agent-client'
2 changes: 1 addition & 1 deletion packages/agents-hosting/src/state/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './userState'
export * from './conversationState'
export * from './agentStatePropertyAccesor'
export * from './agentState'
export { AgentState, CustomKey } from './agentState'
5 changes: 0 additions & 5 deletions packages/agents-hosting/src/turnContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ export type UpdateActivityHandler = (context: TurnContext, activity: Activity, n
*/
export type DeleteActivityHandler = (context: TurnContext, reference: ConversationReference, next: () => Promise<void>) => Promise<void>

/**
* Key for the agent callback handler in TurnState collection.
*/
export const AgentCallbackHandlerKey = 'agentCallbackHandler'

/**
* Represents the context for a single turn in a conversation between a user and an agent.
*
Expand Down
24 changes: 8 additions & 16 deletions packages/agents-hosting/test/hosting/app/agentApplication.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ describe('Application', () => {
called = true
})
const context = new TurnContext(testAdapter, testActivity)
const handled = await app.runInternal(context)
await app.run(context)
await context.sendActivity('test')
assert.equal(called, true)
assert.equal(handled, true)
})

it('should route to an agentic activity handler', async () => {
Expand Down Expand Up @@ -96,10 +95,9 @@ describe('Application', () => {
called = true
})
const context = new TurnContext(testAdapter, testActivity)
const handled = await app.runInternal(context)
await app.run(context)
await context.sendActivity(MessageFactory.text('/yo'))
assert.equal(called, true)
assert.equal(handled, true)
})

it('should route to an agentic message handler with string', async () => {
Expand Down Expand Up @@ -135,10 +133,9 @@ describe('Application', () => {
})
testActivity.text = 'foo'
const context = new TurnContext(testAdapter, testActivity)
const handled = await app.runInternal(context)
await app.run(context)
await context.sendActivity(testActivity)
assert.equal(called, false)
assert.equal(handled, false)
})

it('should route to a message handler with string case insensitive', async () => {
Expand All @@ -151,10 +148,9 @@ describe('Application', () => {
})
testActivity.text = 'FOO'
const context = new TurnContext(testAdapter, testActivity)
const handled = await app.runInternal(context)
await app.run(context)
await context.sendActivity(testActivity)
assert.equal(called, true)
assert.equal(handled, true)
})

it('should route to a act handler with regex', async () => {
Expand All @@ -166,10 +162,9 @@ describe('Application', () => {
called = true
})
const context = new TurnContext(testAdapter, testActivity)
const handled = await app.runInternal(context)
await app.run(context)
await context.sendActivity(MessageFactory.text('/yo'))
assert.equal(called, true)
assert.equal(handled, true)
})

it('should route to a msg handler with regex', async () => {
Expand All @@ -181,10 +176,9 @@ describe('Application', () => {
called = true
})
const context = new TurnContext(testAdapter, testActivity)
const handled = await app.runInternal(context)
await app.run(context)
await context.sendActivity(MessageFactory.text('/yo'))
assert.equal(called, true)
assert.equal(handled, true)
})

it('should ignore sencond message', async () => {
Expand All @@ -201,10 +195,9 @@ describe('Application', () => {
timesCalled++
})
const context = new TurnContext(testAdapter, testActivity)
const handled = await app.runInternal(context)
await app.run(context)
await context.sendActivity('/yo')
assert.equal(timesCalled, 1)
assert.equal(handled, true)
})

it('should ignore sencond message with act', async () => {
Expand All @@ -221,10 +214,9 @@ describe('Application', () => {
timesCalled++
})
const context = new TurnContext(testAdapter, testActivity)
const handled = await app.runInternal(context)
await app.run(context)
await context.sendActivity('/yo')
assert.equal(timesCalled, 1)
assert.equal(handled, true)
})

it('should add TranscriptLoggerMiddleware', async () => {
Expand Down