lex-microsoft_teams 0.6.47 → 0.6.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +6 -1
  4. data/lib/legion/extensions/microsoft_teams/absorbers/channel.rb +2 -1
  5. data/lib/legion/extensions/microsoft_teams/absorbers/chat.rb +2 -1
  6. data/lib/legion/extensions/microsoft_teams/absorbers/meeting.rb +4 -2
  7. data/lib/legion/extensions/microsoft_teams/actors/channel_poller.rb +1 -1
  8. data/lib/legion/extensions/microsoft_teams/runners/api_ingest.rb +2 -0
  9. data/lib/legion/extensions/microsoft_teams/runners/call_events.rb +1 -0
  10. data/lib/legion/extensions/microsoft_teams/runners/channel_messages.rb +1 -0
  11. data/lib/legion/extensions/microsoft_teams/runners/chats.rb +3 -0
  12. data/lib/legion/extensions/microsoft_teams/runners/files.rb +5 -0
  13. data/lib/legion/extensions/microsoft_teams/runners/local_cache.rb +2 -0
  14. data/lib/legion/extensions/microsoft_teams/runners/meeting_artifacts.rb +1 -0
  15. data/lib/legion/extensions/microsoft_teams/runners/meetings.rb +1 -0
  16. data/lib/legion/extensions/microsoft_teams/runners/messages.rb +5 -0
  17. data/lib/legion/extensions/microsoft_teams/runners/ownership.rb +1 -0
  18. data/lib/legion/extensions/microsoft_teams/runners/presence.rb +1 -0
  19. data/lib/legion/extensions/microsoft_teams/runners/profile_ingest.rb +7 -1
  20. data/lib/legion/extensions/microsoft_teams/runners/subscriptions.rb +1 -0
  21. data/lib/legion/extensions/microsoft_teams/runners/teams.rb +1 -0
  22. data/lib/legion/extensions/microsoft_teams/runners/transcripts.rb +1 -0
  23. data/lib/legion/extensions/microsoft_teams/version.rb +1 -1
  24. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f0e5b03a3a863f2faca183a00131d28004da19acd329c8d50a9682e45ea150b
4
- data.tar.gz: 95ebc57ef21c39b5245154154a1d0ba439a7a5a5fb4ccd9b89eb92f2ba800559
3
+ metadata.gz: 7d7ed7b213d241bf12a0a136a8dc25f2947bc9ca3ddd12a9d82209ba48f32a09
4
+ data.tar.gz: d95e3207bd11005fc666fe9b041af5a5f5293258b61e66c178d0ce6d14180621
5
5
  SHA512:
6
- metadata.gz: '084715b8ddefcd486bab4a566507be13f455f2ebccd334529d4fd81fc6c567ff258dc00672f40601b03262792a79364d10a0f835cd2df8d26dfd40ba7ede72d7'
7
- data.tar.gz: e74bf561e91a2ebfe4c178a52ec3678b5a65a30fb0af7cd3fbdcc0ebbbd1a698d58a5fea9c8fc7f9a263b14f5e202cc91accf57f67280285d2e2221c628f137c
6
+ metadata.gz: 69406bc97f76d99714cf2956b42f60f86554878139f7ff2c1af43de259d295c5de2fc0b2440ed77476e5596d1514f7a524109a88baa5315de55d927c6a83f7e7
7
+ data.tar.gz: 4dc517d8e65e5fbed9e685c17e3966da84030a0b5a51087e391903720c3ee49097ca041d83fd1062dad40e4825805d156685cd617305ffe8ca70ca10abb06564
data/.gitignore CHANGED
@@ -7,6 +7,7 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  /Gemfile.lock
10
+ *.gem
10
11
 
11
12
  # rspec failure tracking
12
13
  .rspec_status
data/CHANGELOG.md CHANGED
@@ -1,8 +1,13 @@
1
1
  # Changelog
2
2
 
3
- ## [Unreleased]
3
+ ## [0.6.48] - 2026-05-18
4
+ ### Added
5
+ - Definition DSL declarations across all runners for proper tool discovery and MCP exposure
6
+ - Fix transformer API: map definition[:prompt] to transform(transformation:) for lex-transformer 0.3.8
7
+
4
8
  ### Fixed
5
9
  - Bot response and observation extraction now pass explicit system and user messages to native `Legion::LLM.chat` dispatch instead of routing through the legacy nil-input `llm_chat` helper path.
10
+ - Runner modules that declare `definition` now explicitly `extend Legion::Extensions::Definitions` before those DSL calls, fixing `NoMethodError: undefined method 'definition'` during Legion extension boot.
6
11
 
7
12
  ## [0.6.45] - 2026-04-23
8
13
 
@@ -168,7 +168,8 @@ module Legion
168
168
  tags: ['teams', 'channel', 'thread', channel_name],
169
169
  source_file: "teams://teams/#{team_id}/channels/#{channel_id}/messages/#{msg_id}",
170
170
  heading: "Channel Thread: #{channel_name}#{" — #{subject}" if subject}",
171
- content_type: 'teams_channel_thread'
171
+ content_type: 'teams_channel_thread',
172
+ access_scope: 'private'
172
173
  )
173
174
  results[:chunks] += 1
174
175
  rescue StandardError => e
@@ -116,7 +116,8 @@ module Legion
116
116
  tags: ['teams', 'chat', 'messages', topic],
117
117
  source_file: "teams://chats/#{chat_id}/messages",
118
118
  heading: "Chat: #{topic}",
119
- content_type: 'teams_chat_thread'
119
+ content_type: 'teams_chat_thread',
120
+ access_scope: 'private'
120
121
  )
121
122
  results[:chunks] += 1
122
123
  log.info("Chat#ingest_messages stored #{lines.length} lines for chat_id=#{chat_id}")
@@ -134,7 +134,8 @@ module Legion
134
134
  tags: ['meeting', 'transcript', subject],
135
135
  source_file: "teams://meetings/#{meeting_id}/transcripts/#{transcript_id}",
136
136
  heading: "Transcript: #{subject}",
137
- content_type: 'meeting_transcript'
137
+ content_type: 'meeting_transcript',
138
+ access_scope: 'private'
138
139
  )
139
140
  results[:chunks] += 1
140
141
  end
@@ -174,7 +175,8 @@ module Legion
174
175
  tags: ['meeting', 'ai-insight', 'action-item', subject],
175
176
  source_file: "teams://meetings/#{meeting_id}/insights/#{insight_id}",
176
177
  heading: "AI Insight: #{subject}",
177
- content_type: 'meeting_insight'
178
+ content_type: 'meeting_insight',
179
+ access_scope: 'private'
178
180
  )
179
181
  results[:chunks] += 1
180
182
  end
@@ -36,7 +36,7 @@ module Legion
36
36
  end
37
37
 
38
38
  def enabled?
39
- channel_setting(:enabled, false) == true
39
+ # channel_setting(:enabled, false) == true
40
40
  rescue StandardError => e
41
41
  handle_exception(e, level: :debug, operation: 'ChannelPoller#enabled?')
42
42
  false
@@ -327,6 +327,7 @@ module Legion
327
327
  source_agent: 'teams-api-ingest',
328
328
  source_provider: 'microsoft',
329
329
  source_channel: 'teams_graph_api',
330
+ access_scope: 'private',
330
331
  context: { person: person_name, message_count: texts.length }
331
332
  )
332
333
  ingested += 1 if result[:success]
@@ -356,6 +357,7 @@ module Legion
356
357
  source_agent: 'teams-entity-extractor',
357
358
  source_provider: 'microsoft',
358
359
  source_channel: 'teams_graph_api',
360
+ access_scope: 'private',
359
361
  context: { entity_name: entity[:name], entity_type: entity[:type],
360
362
  confidence: entity[:confidence], extracted_from: person_name }
361
363
  )
@@ -7,6 +7,7 @@ module Legion
7
7
  module MicrosoftTeams
8
8
  module Runners
9
9
  module CallEvents
10
+ extend Legion::Extensions::Definitions
10
11
  include Legion::Extensions::MicrosoftTeams::Helpers::Client
11
12
 
12
13
  def self.trigger_words
@@ -7,6 +7,7 @@ module Legion
7
7
  module MicrosoftTeams
8
8
  module Runners
9
9
  module ChannelMessages
10
+ extend Legion::Extensions::Definitions
10
11
  include Legion::Extensions::MicrosoftTeams::Helpers::Client
11
12
 
12
13
  def self.trigger_words
@@ -23,6 +23,7 @@ module Legion
23
23
  trigger_words: %w[chats conversations]
24
24
 
25
25
  def list_chats(user_id: 'me', top: 50, **)
26
+ log.debug "list_chats(user_id: #{user_id}, top: #{top})"
26
27
  params = { '$top' => top }
27
28
  response = graph_connection(**).get("#{user_path(user_id)}/chats", params)
28
29
  { result: response.body }
@@ -40,6 +41,7 @@ module Legion
40
41
  trigger_words: %w[chat details]
41
42
 
42
43
  def get_chat(chat_id:, **)
44
+ log.debug("get_chat(chat_id: #{chat_id}, **)")
43
45
  response = graph_connection(**).get("chats/#{chat_id}")
44
46
  { result: response.body }
45
47
  end
@@ -74,6 +76,7 @@ module Legion
74
76
  trigger_words: %w[members participants]
75
77
 
76
78
  def list_chat_members(chat_id:, **)
79
+ log.debug "list_chat_members(chat_id: #{chat_id})"
77
80
  response = graph_connection(**).get("chats/#{chat_id}/members")
78
81
  { result: response.body }
79
82
  end
@@ -7,6 +7,7 @@ module Legion
7
7
  module MicrosoftTeams
8
8
  module Runners
9
9
  module Files
10
+ extend Legion::Extensions::Definitions
10
11
  include Legion::Extensions::MicrosoftTeams::Helpers::Client
11
12
 
12
13
  def self.trigger_words
@@ -22,6 +23,7 @@ module Legion
22
23
  trigger_words: %w[files drive onedrive]
23
24
 
24
25
  def list_drive_items(user_id: 'me', **)
26
+ log.debug "list_drive_items(user_id: #{user_id})"
25
27
  response = graph_connection(**).get("#{user_path(user_id)}/drive/root/children")
26
28
  { result: response.body }
27
29
  end
@@ -36,6 +38,7 @@ module Legion
36
38
  trigger_words: %w[file item]
37
39
 
38
40
  def get_drive_item(item_id:, user_id: 'me', **)
41
+ log.debug "get_drive_item(item_id: #{item_id}), user_id: #{user_id}"
39
42
  response = graph_connection(**).get("#{user_path(user_id)}/drive/items/#{item_id}")
40
43
  { result: response.body }
41
44
  end
@@ -50,6 +53,7 @@ module Legion
50
53
  trigger_words: %w[download content read]
51
54
 
52
55
  def get_drive_item_content(item_id:, user_id: 'me', **)
56
+ log.debug "get_drive_item_content(item_id: #{item_id}, user_id: #{user_id})"
53
57
  response = graph_connection(**).get("#{user_path(user_id)}/drive/items/#{item_id}/content")
54
58
  { result: response.body }
55
59
  end
@@ -64,6 +68,7 @@ module Legion
64
68
  trigger_words: %w[sharepoint documents team]
65
69
 
66
70
  def list_team_drive_items(team_id:, **)
71
+ log.debug "list_team_drive_items(team_id: #{team_id})"
67
72
  response = graph_connection(**).get("teams/#{team_id}/drive/root/children")
68
73
  { result: response.body }
69
74
  end
@@ -7,6 +7,8 @@ module Legion
7
7
  module MicrosoftTeams
8
8
  module Runners
9
9
  module LocalCache
10
+ extend Legion::Extensions::Definitions
11
+
10
12
  definition :extract_local_messages, mcp_exposed: false
11
13
  definition :local_cache_available?, mcp_exposed: false
12
14
  definition :local_cache_stats, mcp_exposed: false
@@ -7,6 +7,7 @@ module Legion
7
7
  module MicrosoftTeams
8
8
  module Runners
9
9
  module MeetingArtifacts
10
+ extend Legion::Extensions::Definitions
10
11
  include Legion::Extensions::MicrosoftTeams::Helpers::Client
11
12
 
12
13
  def self.trigger_words
@@ -7,6 +7,7 @@ module Legion
7
7
  module MicrosoftTeams
8
8
  module Runners
9
9
  module Meetings
10
+ extend Legion::Extensions::Definitions
10
11
  include Legion::Extensions::MicrosoftTeams::Helpers::Client
11
12
 
12
13
  def self.trigger_words
@@ -26,6 +26,7 @@ module Legion
26
26
  trigger_words: %w[messages history read]
27
27
 
28
28
  def list_chat_messages(chat_id:, top: 50, **)
29
+ log.debug "list_chat_messages(chat_id: #{chat_id}, top: #{top})"
29
30
  params = { '$top' => top }
30
31
  response = graph_connection(**).get("chats/#{chat_id}/messages", params)
31
32
  { result: response.body }
@@ -43,6 +44,7 @@ module Legion
43
44
  trigger_words: %w[message fetch]
44
45
 
45
46
  def get_chat_message(chat_id:, message_id:, **)
47
+ log.debug "get_chat_message(chat_id: #{chat_id}, message_id: #{message_id})"
46
48
  response = graph_connection(**).get("chats/#{chat_id}/messages/#{message_id}")
47
49
  { result: response.body }
48
50
  end
@@ -60,6 +62,7 @@ module Legion
60
62
  trigger_words: %w[send post write]
61
63
 
62
64
  def send_chat_message(chat_id:, content:, content_type: 'text', attachments: [], **)
65
+ log.debug "send_chat_message(chat_id: #{chat_id}, content: #{content}, content_type: #{content_type})"
63
66
  payload = { body: { contentType: content_type, content: content } }
64
67
  payload[:attachments] = attachments unless attachments.empty?
65
68
  response = graph_connection(**).post("chats/#{chat_id}/messages", payload)
@@ -79,6 +82,7 @@ module Legion
79
82
  trigger_words: %w[reply respond]
80
83
 
81
84
  def reply_to_chat_message(chat_id:, message_id:, content:, content_type: 'text', **)
85
+ log.debug "reply_to_chat_message(chat_id: #{chat_id}, message_id: #{message_id}, content: #{content}, content_type: #{content_type})"
82
86
  payload = { body: { contentType: content_type, content: content } }
83
87
  response = graph_connection(**).post("chats/#{chat_id}/messages/#{message_id}/replies", payload)
84
88
  { result: response.body }
@@ -96,6 +100,7 @@ module Legion
96
100
  trigger_words: %w[replies thread]
97
101
 
98
102
  def list_message_replies(chat_id:, message_id:, top: 50, **)
103
+ log.debug "list_message_replies(chat_id: #{chat_id}, message_id: #{message_id}, top: #{top})"
99
104
  params = { '$top' => top }
100
105
  response = graph_connection(**).get("chats/#{chat_id}/messages/#{message_id}/replies", params)
101
106
  { result: response.body }
@@ -7,6 +7,7 @@ module Legion
7
7
  module MicrosoftTeams
8
8
  module Runners
9
9
  module Ownership
10
+ extend Legion::Extensions::Definitions
10
11
  include Legion::Extensions::MicrosoftTeams::Helpers::Client
11
12
 
12
13
  TEAMS_FILTER = "resourceProvisioningOptions/Any(x:x eq 'Team')"
@@ -7,6 +7,7 @@ module Legion
7
7
  module MicrosoftTeams
8
8
  module Runners
9
9
  module Presence
10
+ extend Legion::Extensions::Definitions
10
11
  include Legion::Extensions::MicrosoftTeams::Helpers::Client
11
12
 
12
13
  def self.trigger_words
@@ -241,7 +241,13 @@ module Legion
241
241
 
242
242
  if defined?(Legion::Extensions::Transformer::Client)
243
243
  client = Legion::Extensions::Transformer::Client.new
244
- result = client.transform(text: text, **definition)
244
+ result = client.transform(
245
+ payload: text,
246
+ transformation: definition[:prompt],
247
+ schema: definition[:schema],
248
+ engine_options: definition[:engine_options] || {},
249
+ name: definition[:name]
250
+ )
245
251
  result[:result] || result[:error] ? nil : result
246
252
  elsif defined?(Legion::LLM)
247
253
  llm_ask(message: "#{definition[:prompt]}\n\nConversation with #{peer_name}:\n#{text}")
@@ -7,6 +7,7 @@ module Legion
7
7
  module MicrosoftTeams
8
8
  module Runners
9
9
  module Subscriptions
10
+ extend Legion::Extensions::Definitions
10
11
  include Legion::Extensions::MicrosoftTeams::Helpers::Client
11
12
 
12
13
  def self.trigger_words
@@ -7,6 +7,7 @@ module Legion
7
7
  module MicrosoftTeams
8
8
  module Runners
9
9
  module Teams
10
+ extend Legion::Extensions::Definitions
10
11
  include Legion::Extensions::MicrosoftTeams::Helpers::Client
11
12
 
12
13
  def self.trigger_words
@@ -7,6 +7,7 @@ module Legion
7
7
  module MicrosoftTeams
8
8
  module Runners
9
9
  module Transcripts
10
+ extend Legion::Extensions::Definitions
10
11
  include Legion::Extensions::MicrosoftTeams::Helpers::Client
11
12
 
12
13
  CONTENT_TYPES = {
@@ -3,7 +3,7 @@
3
3
  module Legion
4
4
  module Extensions
5
5
  module MicrosoftTeams
6
- VERSION = '0.6.47'
6
+ VERSION = '0.6.49'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-microsoft_teams
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.47
4
+ version: 0.6.49
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity