Skip to content

Commit 8220a9c

Browse files
committed
3.2.4 release
1 parent 1c2fc1c commit 8220a9c

41 files changed

Lines changed: 2436 additions & 1369 deletions

Some content is hidden

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

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
Commistant は Microsoft Teams 会議によるコミュニティ イベントをサポートするアシスタント ボットです。
44

5-
[![.github/workflows/develop.yml](https://github.com/karamem0/commistant/actions/workflows/develop.yml/badge.svg)](https://github.com/karamem0/commistant/actions/workflows/develop.yml)
5+
[![.github/workflows/trigger-on-main.yml](https://github.com/karamem0/commistant/actions/workflows/trigger-on-main.yml/badge.svg)](https://github.com/karamem0/commistant/actions/workflows/trigger-on-main.yml)
6+
[![.github/workflows/trigger-on-develop.yml](https://github.com/karamem0/commistant/actions/workflows/trigger-on-develop.yml/badge.svg)](https://github.com/karamem0/commistant/actions/workflows/trigger-on-develop.yml)
67
[![codecov](https://codecov.io/gh/karamem0/commistant/graph/badge.svg?token=Z783SI7V9N)](https://codecov.io/gh/karamem0/commistant)
78
[![License](https://img.shields.io/github/license/karamem0/commistant.svg)](https://github.com/karamem0/commistant/blob/main/LICENSE)
89

source/client/package-lock.json

Lines changed: 850 additions & 836 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/client/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
"dependencies": {
1717
"@automapper/pojos": "^8.8.1",
1818
"@emotion/react": "^11.14.0",
19-
"@fluentui/react-components": "^9.60.0",
20-
"@microsoft/applicationinsights-react-js": "^17.3.5",
19+
"@fluentui/react-components": "^9.60.1",
20+
"@microsoft/applicationinsights-react-js": "^17.3.6",
2121
"@microsoft/applicationinsights-web": "^3.3.6",
2222
"@microsoft/teams-js": "2.34.0",
23-
"axios": "^1.8.1",
23+
"axios": "^1.8.3",
2424
"react": "^18.3.1",
2525
"react-dom": "^18.3.1",
2626
"react-error-boundary": "^5.0.0",
@@ -34,15 +34,15 @@
3434
"devDependencies": {
3535
"@emotion/babel-plugin": "^11.13.5",
3636
"@eslint/eslintrc": "^3.3.0",
37-
"@eslint/js": "^9.21.0",
37+
"@eslint/js": "^9.22.0",
3838
"@formatjs/cli": "^6.6.1",
3939
"@stylistic/eslint-plugin": "^4.2.0",
4040
"@types/react": "^18.3.18",
4141
"@types/react-dom": "^18.3.5",
4242
"@types/react-router-dom": "^5.3.3",
4343
"@vitejs/plugin-react": "^4.3.4",
4444
"babel-plugin-formatjs": "^10.5.35",
45-
"eslint": "^9.21.0",
45+
"eslint": "^9.22.0",
4646
"eslint-plugin-hooks": "^0.4.3",
4747
"eslint-plugin-jsx-a11y": "^6.10.2",
4848
"eslint-plugin-react": "^7.37.4",
@@ -55,7 +55,7 @@
5555
"stylelint-config-recess-order": "^6.0.0",
5656
"stylelint-config-standard-scss": "^14.0.0",
5757
"typescript": "^5.8.2",
58-
"typescript-eslint": "^8.26.0",
58+
"typescript-eslint": "^8.26.1",
5959
"vite": "^6.2.1"
6060
},
6161
"volta": {

source/server/.editorconfig

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,24 +260,25 @@ csharp_blank_lines_after_block_statements = 0
260260

261261
# Line Breaks preferences
262262
csharp_keep_user_linebreaks = false
263-
csharp_max_line_length = 120
263+
csharp_max_line_length = 0
264264
csharp_place_attribute_on_same_line = false
265265
csharp_insert_final_newline = true
266266
csharp_wrap_parameters_style = chop_if_long
267-
csharp_max_formal_parameters_on_line = 3
267+
csharp_max_formal_parameters_on_line = 2
268268
csharp_wrap_after_declaration_lpar = true
269269
csharp_wrap_before_declaration_rpar = true
270270
csharp_wrap_primary_constructor_parameters_style = chop_if_long
271-
csharp_max_primary_constructor_parameters_on_line = 3
271+
csharp_max_primary_constructor_parameters_on_line = 2
272272
csharp_wrap_after_primary_constructor_declaration_lpar = true
273273
csharp_wrap_before_primary_constructor_declaration_rpar = true
274274
csharp_place_constructor_initializer_on_same_line = false
275275
csharp_place_simple_initializer_on_single_line = false
276276
csharp_wrap_arguments_style = chop_if_long
277-
csharp_max_invocation_arguments_on_line = 3
277+
csharp_max_invocation_arguments_on_line = 2
278278
csharp_wrap_after_invocation_lpar = true
279279
csharp_wrap_before_invocation_rpar = true
280-
csharp_wrap_chained_method_calls = chop_if_long
280+
csharp_wrap_chained_method_calls = chop_always
281+
wrap_before_first_method_call = true
281282
csharp_wrap_after_property_in_chained_method_calls = false
282283
csharp_wrap_chained_binary_expressions = chop_if_long
283284
csharp_wrap_chained_binary_patterns = chop_if_long

source/server/Karamem0.Commistant.Bot/Bots/ActivityBot.cs

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,22 @@ protected override async Task OnMembersAddedAsync(
5757
{
5858
if (member.Id == turnContext.Activity.Recipient.Id)
5959
{
60-
var referenceAccessor =
61-
this.conversationState.CreateProperty<ConversationReference>(nameof(ConversationReference));
60+
var referenceAccessor = this.conversationState.CreateProperty<ConversationReference>(nameof(ConversationReference));
6261
var reference = turnContext.Activity.GetConversationReference();
63-
await referenceAccessor.SetAsync(turnContext, reference, cancellationToken);
64-
await this.conversationState.SaveChangesAsync(turnContext, cancellationToken: cancellationToken);
65-
_ = await turnContext.SendActivityAsync(
66-
"<b>Commistant にようこそ!</b>" +
67-
"<br/>" +
68-
"Commistant は Microsoft Teams 会議によるコミュニティ イベントをサポートするアシスタント ボットです。" +
69-
"会議の開始時、終了時、または会議中に定型のメッセージ通知を送信します。" +
70-
"通知にはテキストおよび QR コードつきの URL を添付することができます。",
71-
cancellationToken: cancellationToken
62+
await referenceAccessor.SetAsync(
63+
turnContext,
64+
reference,
65+
cancellationToken
7266
);
67+
await this.conversationState.SaveChangesAsync(turnContext, cancellationToken: cancellationToken);
68+
_ = await turnContext.SendActivityAsync("<b>Commistant にようこそ!</b>" + "<br/>" + "Commistant は Microsoft Teams 会議によるコミュニティ イベントをサポートするアシスタント ボットです。" + "会議の開始時、終了時、または会議中に定型のメッセージ通知を送信します。" + "通知にはテキストおよび QR コードつきの URL を添付することができます。", cancellationToken: cancellationToken);
7369
}
7470
}
75-
await base.OnMembersAddedAsync(membersAdded, turnContext, cancellationToken);
71+
await base.OnMembersAddedAsync(
72+
membersAdded,
73+
turnContext,
74+
cancellationToken
75+
);
7676
}
7777

7878
protected override async Task OnMembersRemovedAsync(
@@ -88,13 +88,14 @@ protected override async Task OnMembersRemovedAsync(
8888
await this.conversationState.DeleteAsync(turnContext, cancellationToken);
8989
}
9090
}
91-
await base.OnMembersRemovedAsync(membersRemoved, turnContext, cancellationToken);
91+
await base.OnMembersRemovedAsync(
92+
membersRemoved,
93+
turnContext,
94+
cancellationToken
95+
);
9296
}
9397

94-
protected override async Task OnMessageActivityAsync(
95-
ITurnContext<IMessageActivity> turnContext,
96-
CancellationToken cancellationToken = default
97-
)
98+
protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken = default)
9899
{
99100
var participant = await TeamsInfo.GetMeetingParticipantAsync(
100101
turnContext,
@@ -116,8 +117,7 @@ protected override async Task OnMessageActivityAsync(
116117
{
117118
if (dc.ActiveDialog is null)
118119
{
119-
var arguments =
120-
await this.openAIService.GetConversationPropertyOptionsAsync(command, cancellationToken);
120+
var arguments = await this.openAIService.GetConversationPropertyOptionsAsync(command, cancellationToken);
121121
var result = arguments?.Type switch
122122
{
123123
Constants.StartMeetingCommand => await dc.BeginDialogAsync(
@@ -135,10 +135,7 @@ protected override async Task OnMessageActivityAsync(
135135
arguments,
136136
cancellationToken: cancellationToken
137137
),
138-
Constants.ResetCommand => await dc.BeginDialogAsync(
139-
nameof(ResetDialog),
140-
cancellationToken: cancellationToken
141-
),
138+
Constants.ResetCommand => await dc.BeginDialogAsync(nameof(ResetDialog), cancellationToken: cancellationToken),
142139
_ => null,
143140
};
144141
if (result is null)
@@ -148,10 +145,7 @@ protected override async Task OnMessageActivityAsync(
148145
}
149146
else
150147
{
151-
_ = await turnContext.SendActivityAsync(
152-
"新しいコマンドを開始する前に中断されたコマンドを完了させてください。",
153-
cancellationToken: cancellationToken
154-
);
148+
_ = await turnContext.SendActivityAsync("新しいコマンドを開始する前に中断されたコマンドを完了させてください。", cancellationToken: cancellationToken);
155149
}
156150
}
157151
}
@@ -168,16 +162,23 @@ CancellationToken cancellationToken
168162
)
169163
{
170164
this.logger.MeetingStarted(turnContext.Activity, meeting.Id);
171-
var propertyAccessor =
172-
this.conversationState.CreateProperty<ConversationProperty>(nameof(ConversationProperty));
173-
var property = await propertyAccessor.GetAsync(turnContext, () => new(), cancellationToken);
165+
var propertyAccessor = this.conversationState.CreateProperty<ConversationProperty>(nameof(ConversationProperty));
166+
var property = await propertyAccessor.GetAsync(
167+
turnContext,
168+
() => new(),
169+
cancellationToken
170+
);
174171
var meetingInfo = await TeamsInfo.GetMeetingInfoAsync(turnContext, cancellationToken: cancellationToken);
175172
property.InMeeting = true;
176173
property.StartMeetingSended = false;
177174
property.EndMeetingSended = false;
178175
property.ScheduledStartTime = meetingInfo.Details.ScheduledStartTime;
179176
property.ScheduledEndTime = meetingInfo.Details.ScheduledEndTime;
180-
await propertyAccessor.SetAsync(turnContext, property, cancellationToken: cancellationToken);
177+
await propertyAccessor.SetAsync(
178+
turnContext,
179+
property,
180+
cancellationToken: cancellationToken
181+
);
181182
}
182183

183184
protected override async Task OnTeamsMeetingEndAsync(
@@ -187,15 +188,22 @@ CancellationToken cancellationToken
187188
)
188189
{
189190
this.logger.MeetingEnded(turnContext.Activity, meeting.Id);
190-
var propertyAccessor =
191-
this.conversationState.CreateProperty<ConversationProperty>(nameof(ConversationProperty));
192-
var property = await propertyAccessor.GetAsync(turnContext, () => new(), cancellationToken);
191+
var propertyAccessor = this.conversationState.CreateProperty<ConversationProperty>(nameof(ConversationProperty));
192+
var property = await propertyAccessor.GetAsync(
193+
turnContext,
194+
() => new(),
195+
cancellationToken
196+
);
193197
property.InMeeting = false;
194198
property.StartMeetingSended = false;
195199
property.EndMeetingSended = false;
196200
property.ScheduledStartTime = null;
197201
property.ScheduledEndTime = null;
198-
await propertyAccessor.SetAsync(turnContext, property, cancellationToken: cancellationToken);
202+
await propertyAccessor.SetAsync(
203+
turnContext,
204+
property,
205+
cancellationToken: cancellationToken
206+
);
199207
}
200208

201209
}

source/server/Karamem0.Commistant.Bot/ConfigureServices.cs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ public static IServiceCollection AddBots(this IServiceCollection services, IConf
3838
_ = services.AddSingleton<BotFrameworkAuthentication, ConfigurationBotFrameworkAuthentication>();
3939
_ = services.AddSingleton<IBotFrameworkHttpAdapter, AdapterWithErrorHandler>();
4040
_ = services.AddSingleton<IStorage>(
41-
new BlobsStorage(new Uri(blobContainerUrl), new DefaultAzureCredential(), new StorageTransferOptions())
41+
new BlobsStorage(
42+
new Uri(blobContainerUrl),
43+
new DefaultAzureCredential(),
44+
new StorageTransferOptions()
45+
)
4246
);
4347
_ = services.AddSingleton<ConversationState>();
4448
_ = services.AddScoped<IBot, ActivityBot>();
@@ -52,13 +56,15 @@ public static IServiceCollection AddDialogs(this IServiceCollection services)
5256
_ = services.AddScoped<InMeetingDialog>();
5357
_ = services.AddScoped<ResetDialog>();
5458
_ = services.AddScoped(
55-
provider =>
56-
new DialogSet(
57-
provider.GetService<ConversationState>()?.CreateProperty<DialogState>(nameof(DialogState))
58-
).Add(provider.GetService<StartMeetingDialog>())
59-
.Add(provider.GetService<EndMeetingDialog>())
60-
.Add(provider.GetService<InMeetingDialog>())
61-
.Add(provider.GetService<ResetDialog>())
59+
provider => new DialogSet(
60+
provider
61+
.GetService<ConversationState>()
62+
?.CreateProperty<DialogState>(nameof(DialogState))
63+
)
64+
.Add(provider.GetService<StartMeetingDialog>())
65+
.Add(provider.GetService<EndMeetingDialog>())
66+
.Add(provider.GetService<InMeetingDialog>())
67+
.Add(provider.GetService<ResetDialog>())
6268
);
6369
return services;
6470
}
@@ -67,12 +73,8 @@ public static IServiceCollection AddServices(this IServiceCollection services, I
6773
{
6874
var openAIEndpointUrl = configuration["AzureOpenAIEndpointUrl"] ?? throw new InvalidOperationException();
6975
var openAIModelName = configuration["AzureOpenAIModelName"] ?? throw new InvalidOperationException();
70-
_ = services.AddScoped(
71-
provider => new AzureOpenAIClient(new Uri(openAIEndpointUrl), new DefaultAzureCredential())
72-
);
73-
_ = services.AddScoped<IOpenAIService>(
74-
provider => new OpenAIService(provider.GetRequiredService<AzureOpenAIClient>(), openAIModelName)
75-
);
76+
_ = services.AddScoped(provider => new AzureOpenAIClient(new Uri(openAIEndpointUrl), new DefaultAzureCredential()));
77+
_ = services.AddScoped<IOpenAIService>(provider => new OpenAIService(provider.GetRequiredService<AzureOpenAIClient>(), openAIModelName));
7678
_ = services.AddScoped<QRCodeGenerator>();
7779
_ = services.AddScoped<IQRCodeService, QRCodeService>();
7880
return services;

source/server/Karamem0.Commistant.Bot/Controllers/BotController.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ public class BotController(IBotFrameworkHttpAdapter adapter, IBot bot) : Control
2929
[HttpPost()]
3030
public async Task PostAsync()
3131
{
32-
await this.adapter.ProcessAsync(this.Request, this.Response, this.bot);
32+
await this.adapter.ProcessAsync(
33+
this.Request,
34+
this.Response,
35+
this.bot
36+
);
3337
}
3438

3539
}

source/server/Karamem0.Commistant.Bot/Dialogs/EndMeetingDialog.cs

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,14 @@ protected override async Task OnInitializeAsync(DialogContext dc)
5858
await base.OnInitializeAsync(dc);
5959
}
6060

61-
private async Task<DialogTurnResult> OnBeforeAsync(
62-
WaterfallStepContext stepContext,
63-
CancellationToken cancellationToken = default
64-
)
61+
private async Task<DialogTurnResult> OnBeforeAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken = default)
6562
{
6663
var accessor = this.conversationState.CreateProperty<ConversationProperty>(nameof(ConversationProperty));
67-
var property = await accessor.GetAsync(stepContext.Context, () => new(), cancellationToken);
64+
var property = await accessor.GetAsync(
65+
stepContext.Context,
66+
() => new(),
67+
cancellationToken
68+
);
6869
var options = (ConversationPropertyOptions?)stepContext.Options;
6970
var value = this.mapper.Map(
7071
options,
@@ -169,18 +170,19 @@ property with
169170
);
170171
}
171172

172-
private async Task<DialogTurnResult> OnAfterAsync(
173-
WaterfallStepContext stepContext,
174-
CancellationToken cancellationToken = default
175-
)
173+
private async Task<DialogTurnResult> OnAfterAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken = default)
176174
{
177175
var value = (JObject)stepContext.Context.Activity.Value;
178176
if (value is null)
179177
{
180178
return await stepContext.EndDialogAsync(cancellationToken: cancellationToken);
181179
}
182180
var accessor = this.conversationState.CreateProperty<ConversationProperty>(nameof(ConversationProperty));
183-
var property = await accessor.GetAsync(stepContext.Context, () => new(), cancellationToken);
181+
var property = await accessor.GetAsync(
182+
stepContext.Context,
183+
() => new(),
184+
cancellationToken
185+
);
184186
if (value.Value<string>("Button") == "Submit")
185187
{
186188
property.EndMeetingSchedule = value.Value("Schedule", -1);
@@ -295,7 +297,11 @@ private async Task<DialogTurnResult> OnAfterAsync(
295297
}
296298
]
297299
};
298-
if (Uri.TryCreate(property.EndMeetingUrl, UriKind.Absolute, out var url))
300+
if (Uri.TryCreate(
301+
property.EndMeetingUrl,
302+
UriKind.Absolute,
303+
out var url
304+
))
299305
{
300306
var bytes = await this.qrCodeService.CreateAsync(url.ToString(), cancellationToken);
301307
var base64 = Convert.ToBase64String(bytes);

0 commit comments

Comments
 (0)